/// <summary>
        /// Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist.
        /// Documentation https://developers.google.com/youtubereporting/v1/reference/reports/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 YouTubeReporting service.</param>
        /// <param name="jobId">The ID of the job.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListReportsResponseResponse</returns>
        public static ListReportsResponse List(YouTubeReportingService service, string jobId, ReportsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (jobId == null)
                {
                    throw new ArgumentNullException(jobId);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Reports.List failed.", ex);
            }
        }
        /// <summary>
        /// Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`.
        /// Documentation https://developers.google.com/youtubereporting/v1/reference/media/download
        /// 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 YouTubeReporting service.</param>
        /// <param name="resourceName">Name of the media that is being downloaded. See ReadRequest.resource_name.</param>
        /// <returns>MediaResponse</returns>
        public static Media Download(YouTubeReportingService service, string resourceName)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (resourceName == null)
                {
                    throw new ArgumentNullException(resourceName);
                }

                // Make the request.
                return(service.Media.Download(resourceName).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Media.Download failed.", ex);
            }
        }