Updates a workflow using Ruby.
from google.cloud import workflows_v1 def sample_update_workflow(): # Create a client client = workflows_v1.WorkflowsClient() # Initialize request argument(s) workflow = workflows_v1.Workflow() workflow.source_contents = "source_contents_value" request = workflows_v1.UpdateWorkflowRequest( workflow=workflow, ) # Make the request operation = client.update_workflow(request=request) print("Waiting for operation to complete...") response = operation.result() # Handle the response print(response)
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 # 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 # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.