/// <summary>
        /// List delegation signer records for the domain in the account.
        /// </summary>
        /// <param name="accountId">The account id</param>
        /// <param name="domainIdentifier">The domain name or id</param>
        /// <param name="options">Options passed to the list (sorting, pagination)</param>
        /// <returns>A list of delegation signer records wrapped in a response</returns>
        /// <see>https://developer.dnsimple.com/v2/domains/dnssec/#listDomainDelegationSignerRecords</see>
        public PaginatedDnsimpleResponse <DelegationSignerRecord> ListDelegationSignerRecords(
            long accountId, string domainIdentifier, ListDomainDelegationSignerRecordsOptions options)
        {
            var requestBuilder =
                Client.Http.RequestBuilder(DsRecordsPath(accountId,
                                                         domainIdentifier));

            requestBuilder.AddParameter(options.UnpackSorting());

            if (!options.Pagination.IsDefault())
            {
                requestBuilder.AddParameters(options.UnpackPagination());
            }

            return(new PaginatedDnsimpleResponse <DelegationSignerRecord>(
                       Client.Http.Execute(requestBuilder.Request)));
        }
Пример #2
0
        public void ListDelegationSignerRecordsWithOptions(long accountId, string domainIdentifier, string expectedUrl)
        {
            var options = new ListDomainDelegationSignerRecordsOptions
            {
                Pagination = new Pagination {
                    Page = 3, PerPage = 5
                }
            };

            options.SortById(Order.asc).SortByCreatedAt(Order.desc);

            var client  = new MockDnsimpleClient(ListRecordsFixture);
            var records =
                client.Domains.ListDelegationSignerRecords(accountId,
                                                           domainIdentifier, options);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(1, records.Data.DelegationSignerRecords.Count);
                Assert.AreEqual(1, records.PaginationData.CurrentPage);

                Assert.AreEqual(expectedUrl, client.RequestSentTo());
            });
        }
Пример #3
0
        /// <summary>
        /// Lists the Delegation Signer records for the domain.
        /// </summary>
        /// <param name="accountId">The account ID</param>
        /// <param name="domainIdentifier">The domain name or ID</param>
        /// <param name="options">Options passed to the list (sorting, pagination)</param>
        /// <returns>A list of delegation signer records wrapped in a response</returns>
        /// <see>https://developer.dnsimple.com/v2/domains/dnssec/#listDomainDelegationSignerRecords</see>
        public PaginatedResponse <DelegationSignerRecord> ListDelegationSignerRecords(long accountId, string domainIdentifier, ListDomainDelegationSignerRecordsOptions options = null)
        {
            var builder = BuildRequestForPath(DsRecordsPath(accountId, domainIdentifier));

            AddListOptionsToRequest(options, ref builder);

            return(new PaginatedResponse <DelegationSignerRecord>(Execute(builder.Request)));
        }