示例#1
0
        public static async Task DeleteDomain(this IDomainClient domainClient, DomainName domainName, CancellationToken cancellationToken = default)
        {
            if (domainClient is null)
            {
                throw new ArgumentNullException(nameof(domainClient));
            }

            var domain = await domainClient.GetDomain(domainName, cancellationToken).ConfigureAwait(false);

            await domainClient.DeleteDomain(domain.Id, cancellationToken).ConfigureAwait(false);
        }
示例#2
0
        public static async Task <Domain> GetDomain(this IDomainClient domainClient, string domainName, CancellationToken cancellationToken = default)
        {
            if (domainClient is null)
            {
                throw new ArgumentNullException(nameof(domainClient));
            }
            if (domainName is null)
            {
                throw new ArgumentNullException(nameof(domainName));
            }

            return(await domainClient.GetDomain(DomainName.Parse(domainName), cancellationToken).ConfigureAwait(false));
        }
示例#3
0
        public static async Task UpdateDomain(
            this IDomainClient domainClient,
            DomainName domainName,
            Value <DomainName> name                                  = default,
            Value <bool> gtdEnabled                                  = default,
            Value <SoaId?> soaId                                     = default,
            Value <TemplateId?> templateId                           = default,
            Value <VanityId?> vanityId                               = default,
            Value <TransferAclId?> transferAclId                     = default,
            Value <FolderId> folderId                                = default,
            Value <ImmutableArray <DomainName>?> axfrServer          = default,
            Value <ImmutableArray <DomainName>?> delegateNameServers = default,
            CancellationToken cancellationToken                      = default
            )
        {
            if (domainClient is null)
            {
                throw new ArgumentNullException(nameof(domainClient));
            }

            var domain = await domainClient.GetDomain(domainName, cancellationToken).ConfigureAwait(false);

            await domainClient.UpdateDomain(domain.Id, name, gtdEnabled, soaId, templateId, vanityId, transferAclId, folderId, axfrServer, delegateNameServers, cancellationToken).ConfigureAwait(false);
        }