示例#1
0
        /// <summary>
        /// Resumes a transfer operation that is paused.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/transferOperations/resume
        /// 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 storagetransfer service.</param>
        /// <param name="name">The name of the transfer operation. Required.</param>
        /// <param name="body">A valid storagetransfer v1 body.</param>
        /// <returns>EmptyResponse</returns>
        public static Empty Resume(storagetransferService service, string name, ResumeTransferOperationRequest 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.TransferOperations.Resume(body, name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TransferOperations.Resume failed.", ex);
            }
        }
示例#2
0
        /// <summary>
        /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/transferOperations/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 storagetransfer service.</param>
        /// <param name="name">The value `transferOperations`.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListOperationsResponseResponse</returns>
        public static ListOperationsResponse List(storagetransferService service, string name, TransferOperationsListOptionalParms 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.TransferOperations.List(name);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TransferOperations.List failed.", ex);
            }
        }
示例#3
0
        /// <summary>
        /// Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating the scheduling of a job is not allowed.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/transferJobs/patch
        /// 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 storagetransfer service.</param>
        /// <param name="jobName">The name of job to update. Required.</param>
        /// <param name="body">A valid storagetransfer v1 body.</param>
        /// <returns>TransferJobResponse</returns>
        public static TransferJob Patch(storagetransferService service, string jobName, UpdateTransferJobRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (jobName == null)
                {
                    throw new ArgumentNullException(jobName);
                }

                // Make the request.
                return(service.TransferJobs.Patch(body, jobName).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TransferJobs.Patch failed.", ex);
            }
        }
示例#4
0
        /// <summary>
        /// Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/googleServiceAccounts/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 storagetransfer service.</param>
        /// <param name="projectId">The ID of the Google Developers Console project that the Google service account is associated with. Required.</param>
        /// <returns>GoogleServiceAccountResponse</returns>
        public static GoogleServiceAccount Get(storagetransferService service, string projectId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }

                // Make the request.
                return(service.GoogleServiceAccounts.Get(projectId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GoogleServiceAccounts.Get failed.", ex);
            }
        }
示例#5
0
        /// <summary>
        /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/transferOperations/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 storagetransfer service.</param>
        /// <param name="name">The name of the operation resource.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Get(storagetransferService 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.TransferOperations.Get(name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TransferOperations.Get failed.", ex);
            }
        }
示例#6
0
        /// <summary>
        /// Creates a transfer job that runs periodically.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/transferJobs/create
        /// 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 storagetransfer service.</param>
        /// <param name="body">A valid storagetransfer v1 body.</param>
        /// <returns>TransferJobResponse</returns>
        public static TransferJob Create(storagetransferService service, TransferJob body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.TransferJobs.Create(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TransferJobs.Create failed.", ex);
            }
        }
示例#7
0
        /// <summary>
        /// Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.
        /// Documentation https://developers.google.com/storagetransfer/v1/reference/v1/getGoogleServiceAccount
        /// 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 storagetransfer service.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>GoogleServiceAccountResponse</returns>
        public static GoogleServiceAccount GetGoogleServiceAccount(storagetransferService service, V1GetGoogleServiceAccountOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.V1.GetGoogleServiceAccount();

                // Applying optional parameters to the request.
                request = (V1Resource.GetGoogleServiceAccountRequest)SampleHelpers.ApplyOptionalParms(request, optional);

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