/// <summary>
        /// Lists all projects to which you have been granted any project role.
        /// Documentation https://developers.google.com/bigquery/v2/reference/projects/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="optional">Optional paramaters.</param>
        /// <returns>ProjectListResponse</returns>
        public static ProjectList List(BigqueryService service, ProjectsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Projects.List failed.", ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves table data from a specified set of rows. Requires the READER dataset role.
        /// Documentation https://developers.google.com/bigquery/v2/reference/tabledata/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 table to read</param>
        /// <param name="datasetId">Dataset ID of the table to read</param>
        /// <param name="tableId">Table ID of the table to read</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>TableDataListResponse</returns>
        public static TableDataList List(BigqueryService service, string projectId, string datasetId, string tableId, TabledataListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }
                if (datasetId == null)
                {
                    throw new ArgumentNullException(datasetId);
                }
                if (tableId == null)
                {
                    throw new ArgumentNullException(tableId);
                }

                // Building the initial request.
                var request = service.Tabledata.List(projectId, datasetId, tableId);

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

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