コード例 #1
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/servicemanagement/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 Servicemanagement service.</param>
        /// <param name="name">The name of the operation resource.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Get(ServicemanagementService 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);
            }
        }
コード例 #2
0
        /// <summary>
        /// Lists service operations that match the specified filter in the request.
        /// Documentation https://developers.google.com/servicemanagement/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 Servicemanagement service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ListOperationsResponseResponse</returns>
        public static ListOperationsResponse List(ServicemanagementService service, OperationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

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

                // 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);
            }
        }