コード例 #1
0
        /// <summary>
        /// Delete a previously created ManagedZone.
        /// Documentation https://developers.google.com/dns/v1/reference/managedZones/delete
        /// 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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="managedZone">Identifies the managed zone addressed by this request. Can be the managed zone name or id.</param>
        public static void Delete(dnsService service, string project, string managedZone)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (managedZone == null)
                {
                    throw new ArgumentNullException(managedZone);
                }

                // Make the request.
                return(service.ManagedZones.Delete(project, managedZone).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ManagedZones.Delete failed.", ex);
            }
        }
コード例 #2
0
        /// <summary>
        /// Enumerate Operations for the given ManagedZone.
        /// Documentation https://developers.google.com/dns/v2beta1/reference/managedZoneOperations/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="managedZone">Identifies the managed zone addressed by this request.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ManagedZoneOperationsListResponseResponse</returns>
        public static ManagedZoneOperationsListResponse List(dnsService service, string project, string managedZone, ManagedZoneOperationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (managedZone == null)
                {
                    throw new ArgumentNullException(managedZone);
                }

                // Building the initial request.
                var request = service.ManagedZoneOperations.List(project, managedZone);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ManagedZoneOperations.List failed.", ex);
            }
        }
コード例 #3
0
        /// <summary>
        /// Create a new ManagedZone.
        /// Documentation https://developers.google.com/dns/v1/reference/managedZones/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="body">A valid dns v1 body.</param>
        /// <returns>ManagedZoneResponse</returns>
        public static ManagedZone Create(dnsService service, string project, ManagedZone body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Make the request.
                return(service.ManagedZones.Create(body, project).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ManagedZones.Create failed.", ex);
            }
        }
コード例 #4
0
        /// <summary>
        /// Fetch the representation of an existing Change.
        /// Documentation https://developers.google.com/dns/v1/reference/changes/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="managedZone">Identifies the managed zone addressed by this request. Can be the managed zone name or id.</param>
        /// <param name="changeId">The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.</param>
        /// <returns>ChangeResponse</returns>
        public static Change Get(dnsService service, string project, string managedZone, string changeId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (managedZone == null)
                {
                    throw new ArgumentNullException(managedZone);
                }
                if (changeId == null)
                {
                    throw new ArgumentNullException(changeId);
                }

                // Make the request.
                return(service.Changes.Get(project, managedZone, changeId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Changes.Get failed.", ex);
            }
        }
コード例 #5
0
        /// <summary>
        /// Create a new ManagedZone.
        /// Documentation https://developers.google.com/dns/v2beta1/reference/managedZones/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="body">A valid dns v2beta1 body.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ManagedZoneResponse</returns>
        public static ManagedZone Create(dnsService service, string project, ManagedZone body, ManagedZonesCreateOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Building the initial request.
                var request = service.ManagedZones.Create(body, project);

                // Applying optional parameters to the request.
                request = (ManagedZonesResource.CreateRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ManagedZones.Create failed.", ex);
            }
        }
コード例 #6
0
        /// <summary>
        /// Fetch the representation of an existing Project.
        /// Documentation https://developers.google.com/dns/v2beta1/reference/projects/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ProjectResponse</returns>
        public static Project Get(dnsService service, string project, ProjectsGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Projects.Get failed.", ex);
            }
        }
コード例 #7
0
        /// <summary>
        /// Fetch the representation of an existing Project.
        /// Documentation https://developers.google.com/dns/v1/reference/projects/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 dns service.</param>
        /// <param name="project">Identifies the project addressed by this request.</param>
        /// <returns>ProjectResponse</returns>
        public static Project Get(dnsService service, string project)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Make the request.
                return(service.Projects.Get(project).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Projects.Get failed.", ex);
            }
        }