Ejemplo n.º 1
0
        /// <summary>Snippet for RunPipeline</summary>
        public void RunPipelineRequestObject()
        {
            // Snippet: RunPipeline(RunPipelineRequest, CallSettings)
            // Create client
            WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient = WorkflowsServiceV2BetaClient.Create();
            // Initialize request argument(s)
            RunPipelineRequest request = new RunPipelineRequest
            {
                Pipeline    = new Pipeline(),
                Labels      = { { "", "" }, },
                PubSubTopic = "",
                Parent      = "",
            };
            // Make the request
            Operation <RunPipelineResponse, Metadata> response = workflowsServiceV2BetaClient.RunPipeline(request);

            // Poll until the returned long-running operation is complete
            Operation <RunPipelineResponse, Metadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            RunPipelineResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <RunPipelineResponse, Metadata> retrievedResponse = workflowsServiceV2BetaClient.PollOnceRunPipeline(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                RunPipelineResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>
        /// Runs a pipeline. If `pipelineId` is specified in the request, then run a saved pipeline. If `ephemeralPipeline` is specified, then run that pipeline once without saving a copy. The caller must have READ permission to the project where the pipeline is stored and WRITE permission to the project where the pipeline will be run, as VMs will be created and storage will be used.
        /// Documentation https://developers.google.com/genomics/v1alpha2/reference/pipelines/run
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated genomics service.</param>
        /// <param name="body">A valid genomics v1alpha2 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Run(genomicsService service, RunPipelineRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Pipelines.Run(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Pipelines.Run failed.", ex);
            }
        }
 /// <summary>
 /// Runs a pipeline.  The returned Operation's [metadata]
 /// [google.longrunning.Operation.metadata] field will contain a
 /// [google.cloud.lifesciences.v2beta.Metadata][google.cloud.lifesciences.v2beta.Metadata] object describing the status
 /// of the pipeline execution. The
 /// [response][google.longrunning.Operation.response] field will contain a
 /// [google.cloud.lifesciences.v2beta.RunPipelineResponse][google.cloud.lifesciences.v2beta.RunPipelineResponse] object if the
 /// pipeline completes successfully.
 ///
 /// **Note:** Before you can use this method, the *Life Sciences Service Agent*
 /// must have access to your project. This is done automatically when the
 /// Cloud Life Sciences API is first enabled, but if you delete this permission
 /// you must disable and re-enable the API to grant the Life Sciences
 /// Service Agent the required permissions.
 /// Authorization requires the following [Google
 /// IAM](https://cloud.google.com/iam/) permission:
 ///
 /// * `lifesciences.workflows.run`
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override async stt::Task <lro::Operation <RunPipelineResponse, Metadata> > RunPipelineAsync(RunPipelineRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_RunPipelineRequest(ref request, ref callSettings);
     return(new lro::Operation <RunPipelineResponse, Metadata>(await _callRunPipeline.Async(request, callSettings).ConfigureAwait(false), RunPipelineOperationsClient));
 }
 /// <summary>
 /// Runs a pipeline.  The returned Operation's [metadata]
 /// [google.longrunning.Operation.metadata] field will contain a
 /// [google.cloud.lifesciences.v2beta.Metadata][google.cloud.lifesciences.v2beta.Metadata] object describing the status
 /// of the pipeline execution. The
 /// [response][google.longrunning.Operation.response] field will contain a
 /// [google.cloud.lifesciences.v2beta.RunPipelineResponse][google.cloud.lifesciences.v2beta.RunPipelineResponse] object if the
 /// pipeline completes successfully.
 ///
 /// **Note:** Before you can use this method, the *Life Sciences Service Agent*
 /// must have access to your project. This is done automatically when the
 /// Cloud Life Sciences API is first enabled, but if you delete this permission
 /// you must disable and re-enable the API to grant the Life Sciences
 /// Service Agent the required permissions.
 /// Authorization requires the following [Google
 /// IAM](https://cloud.google.com/iam/) permission:
 ///
 /// * `lifesciences.workflows.run`
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override lro::Operation <RunPipelineResponse, Metadata> RunPipeline(RunPipelineRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_RunPipelineRequest(ref request, ref callSettings);
     return(new lro::Operation <RunPipelineResponse, Metadata>(_callRunPipeline.Sync(request, callSettings), RunPipelineOperationsClient));
 }
 partial void Modify_RunPipelineRequest(ref RunPipelineRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Runs a pipeline.  The returned Operation's [metadata]
 /// [google.longrunning.Operation.metadata] field will contain a
 /// [google.cloud.lifesciences.v2beta.Metadata][google.cloud.lifesciences.v2beta.Metadata] object describing the status
 /// of the pipeline execution. The
 /// [response][google.longrunning.Operation.response] field will contain a
 /// [google.cloud.lifesciences.v2beta.RunPipelineResponse][google.cloud.lifesciences.v2beta.RunPipelineResponse] object if the
 /// pipeline completes successfully.
 ///
 /// **Note:** Before you can use this method, the *Life Sciences Service Agent*
 /// must have access to your project. This is done automatically when the
 /// Cloud Life Sciences API is first enabled, but if you delete this permission
 /// you must disable and re-enable the API to grant the Life Sciences
 /// Service Agent the required permissions.
 /// Authorization requires the following [Google
 /// IAM](https://cloud.google.com/iam/) permission:
 ///
 /// * `lifesciences.workflows.run`
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <lro::Operation <RunPipelineResponse, Metadata> > RunPipelineAsync(RunPipelineRequest request, st::CancellationToken cancellationToken) =>
 RunPipelineAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Runs a pipeline.  The returned Operation's [metadata]
 /// [google.longrunning.Operation.metadata] field will contain a
 /// [google.cloud.lifesciences.v2beta.Metadata][google.cloud.lifesciences.v2beta.Metadata] object describing the status
 /// of the pipeline execution. The
 /// [response][google.longrunning.Operation.response] field will contain a
 /// [google.cloud.lifesciences.v2beta.RunPipelineResponse][google.cloud.lifesciences.v2beta.RunPipelineResponse] object if the
 /// pipeline completes successfully.
 ///
 /// **Note:** Before you can use this method, the *Life Sciences Service Agent*
 /// must have access to your project. This is done automatically when the
 /// Cloud Life Sciences API is first enabled, but if you delete this permission
 /// you must disable and re-enable the API to grant the Life Sciences
 /// Service Agent the required permissions.
 /// Authorization requires the following [Google
 /// IAM](https://cloud.google.com/iam/) permission:
 ///
 /// * `lifesciences.workflows.run`
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <lro::Operation <RunPipelineResponse, Metadata> > RunPipelineAsync(RunPipelineRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();