Ejemplo n.º 1
0
        /// <summary>
        /// Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
        /// Documentation https://developers.google.com/bigquery/v2/reference/jobs/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 bigquery service.</param>
        /// <param name="projectId">Project ID of the jobs to list</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>JobListResponse</returns>
        public static JobList List(bigqueryService service, string projectId, JobsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Jobs.List failed.", ex);
            }
        }
Ejemplo n.º 2
0
        /// <param name="optional">Optional paramaters.</param>        /// <returns>GoogleCloudMlV1beta1__ListJobsResponseResponse</returns>
        public static GoogleCloudMlV1beta1__ListJobsResponse List(CloudMachineLearningService service, string parent, JobsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (parent == null)
                {
                    throw new ArgumentNullException(parent);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Jobs.List failed.", ex);
            }
        }