lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb in google-cloud-notebooks-v2-0.1.0 vs lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb in google-cloud-notebooks-v2-0.2.0

- old
+ new

@@ -237,10 +237,30 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Notebooks::V2::ListInstancesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Notebooks::V2::Instance. + # p item + # end + # def list_instances request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::ListInstancesRequest @@ -300,10 +320,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Notebooks::V2::Instance] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Notebooks::V2::Instance. + # p result + # def get_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::GetInstanceRequest @@ -369,10 +405,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::CreateInstanceRequest @@ -436,10 +495,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::UpdateInstanceRequest @@ -502,10 +584,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::DeleteInstanceRequest @@ -566,10 +671,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::StartInstanceRequest.new + # + # # Call the start_instance method. + # result = client.start_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def start_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::StartInstanceRequest @@ -630,10 +758,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::StopInstanceRequest.new + # + # # Call the stop_instance method. + # result = client.stop_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def stop_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::StopInstanceRequest @@ -694,10 +845,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::ResetInstanceRequest.new + # + # # Call the reset_instance method. + # result = client.reset_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def reset_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::ResetInstanceRequest @@ -758,10 +932,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest.new + # + # # Call the check_instance_upgradability method. + # result = client.check_instance_upgradability request + # + # # The returned object is of type Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse. + # p result + # def check_instance_upgradability request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest @@ -821,10 +1011,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::UpgradeInstanceRequest.new + # + # # Call the upgrade_instance method. + # result = client.upgrade_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def upgrade_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::UpgradeInstanceRequest @@ -888,10 +1101,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::RollbackInstanceRequest.new + # + # # Call the rollback_instance method. + # result = client.rollback_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def rollback_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::RollbackInstanceRequest @@ -956,9 +1192,32 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest.new + # + # # Call the diagnose_instance method. + # result = client.diagnose_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # 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::V2::DiagnoseInstanceRequest