Exemplo n.º 1
0
        /// <summary>
        /// Starts asynchronous cancellation on a long-running operation.  The servermakes a best effort to cancel the operation, but success is notguaranteed.  If the server doesn't support this method, it returns`google.rpc.Code.UNIMPLEMENTED`.  Clients can useOperations.GetOperation orother methods to check whether the cancellation succeeded or whether theoperation completed despite cancellation. On successful cancellation,the operation is not deleted; instead, it becomes an operation withan Operation.error value with a google.rpc.Status.code of 1,corresponding to `Code.CANCELLED`.
        /// Documentation https://developers.google.com/cloudbuild/v1/reference/operations/cancel
        /// 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 Cloudbuild service.</param>
        /// <param name="name">The name of the operation resource to be cancelled.</param>
        /// <param name="body">A valid Cloudbuild v1 body.</param>
        /// <returns>EmptyResponse</returns>
        public static Empty Cancel(CloudbuildService service, string name, CancelOperationRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Make the request.
                return(service.Operations.Cancel(body, name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Operations.Cancel failed.", ex);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lists operations that match the specified filter in the request. If theserver doesn't support this method, it returns `UNIMPLEMENTED`.NOTE: the `name` binding allows API services to override the bindingto use different resource name schemes, such as `users/*/operations`. Tooverride 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 operationscollection id, however overriding users must ensure the name bindingis the parent resource, without the operations collection id.
        /// Documentation https://developers.google.com/cloudbuild/v1/reference/operations/list
        /// 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 Cloudbuild service.</param>
        /// <param name="name">The name of the operation's parent resource.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ListOperationsResponseResponse</returns>
        public static ListOperationsResponse List(CloudbuildService service, string name, OperationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Building the initial request.
                var request = service.Operations.List(name);

                // Applying optional parameters to the request.
                request = (OperationsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Operations.List failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the latest state of a long-running operation.  Clients can use thismethod to poll the operation result at intervals as recommended by the APIservice.
        /// Documentation https://developers.google.com/cloudbuild/v1/reference/operations/get
        /// 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 Cloudbuild service.</param>
        /// <param name="name">The name of the operation resource.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Get(CloudbuildService service, string name)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Make the request.
                return(service.Operations.Get(name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Operations.Get failed.", ex);
            }
        }