import { APIResource } from "../../../core/resource.js";
import * as DNSAPI from "./dns.js";
import { BaseDNS, DNS, DNSGetParams } from "./dns.js";
import { APIPromise } from "../../../core/api-promise.js";
import { PagePromise, SinglePage } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class BaseSubdomains extends APIResource {
static readonly _key: readonly ['emailSending', 'subdomains'];
/**
* Creates a new sending subdomain or re-enables sending on an existing subdomain
* that had it disabled. If zone-level Email Sending has not been enabled yet, the
* zone flag is automatically set when the entitlement is present. A leftmost
* wildcard such as `*.example.com` is accepted only for accounts with wildcard
* Email Sending enabled. Wildcard senders share the base domain's DKIM signing
* identity and `cf-bounce.` return path.
*
* @example
* ```ts
* const subdomain =
* await client.emailSending.subdomains.create({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* name: 'sub.example.com',
* });
* ```
*/
create(params: SubdomainCreateParams, options?: RequestOptions): APIPromise;
/**
* Lists all sending-enabled subdomains for the zone.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const subdomainListResponse of client.emailSending.subdomains.list(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params: SubdomainListParams, options?: RequestOptions): PagePromise;
/**
* Disables sending on a subdomain and removes its DNS records. If routing is still
* active on the subdomain, only sending is disabled.
*
* @example
* ```ts
* const subdomain =
* await client.emailSending.subdomains.delete(
* 'aabbccdd11223344aabbccdd11223344',
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(subdomainID: string, params: SubdomainDeleteParams, options?: RequestOptions): APIPromise;
/**
* Gets information for a specific sending subdomain.
*
* @example
* ```ts
* const subdomain = await client.emailSending.subdomains.get(
* 'aabbccdd11223344aabbccdd11223344',
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(subdomainID: string, params: SubdomainGetParams, options?: RequestOptions): APIPromise;
}
export declare class Subdomains extends BaseSubdomains {
dns: DNSAPI.DNS;
}
export type SubdomainListResponsesSinglePage = SinglePage;
export interface SubdomainCreateResponse {
/**
* Whether Email Sending is enabled on this subdomain.
*/
enabled: boolean;
/**
* The exact domain name or a leftmost wildcard such as `*.example.com`.
*/
name: string;
/**
* Sending subdomain identifier.
*/
tag: string;
/**
* The date and time the destination address has been created.
*/
created?: string;
/**
* The DKIM selector used for email signing. Wildcard rows publish the selector and
* sign with `d=`.
*/
dkim_selector?: string;
/**
* The date and time the destination address was last modified.
*/
modified?: string;
/**
* Whether sent messages from this subdomain can be previewed in the activity log.
*/
preview_enabled?: boolean;
/**
* The return-path domain used for bounce handling. Wildcard rows use
* `cf-bounce.`.
*/
return_path_domain?: string;
}
export interface SubdomainListResponse {
/**
* Whether Email Sending is enabled on this subdomain.
*/
enabled: boolean;
/**
* The exact domain name or a leftmost wildcard such as `*.example.com`.
*/
name: string;
/**
* Sending subdomain identifier.
*/
tag: string;
/**
* The date and time the destination address has been created.
*/
created?: string;
/**
* The DKIM selector used for email signing. Wildcard rows publish the selector and
* sign with `d=`.
*/
dkim_selector?: string;
/**
* The date and time the destination address was last modified.
*/
modified?: string;
/**
* Whether sent messages from this subdomain can be previewed in the activity log.
*/
preview_enabled?: boolean;
/**
* The return-path domain used for bounce handling. Wildcard rows use
* `cf-bounce.`.
*/
return_path_domain?: string;
}
export interface SubdomainDeleteResponse {
errors: Array;
messages: Array;
/**
* Whether the API call was successful.
*/
success: true;
}
export declare namespace SubdomainDeleteResponse {
interface Error {
code: number;
message: string;
documentation_url?: string;
source?: Error.Source;
}
namespace Error {
interface Source {
pointer?: string;
}
}
interface Message {
code: number;
message: string;
documentation_url?: string;
source?: Message.Source;
}
namespace Message {
interface Source {
pointer?: string;
}
}
}
export interface SubdomainGetResponse {
/**
* Whether Email Sending is enabled on this subdomain.
*/
enabled: boolean;
/**
* The exact domain name or a leftmost wildcard such as `*.example.com`.
*/
name: string;
/**
* Sending subdomain identifier.
*/
tag: string;
/**
* The date and time the destination address has been created.
*/
created?: string;
/**
* The DKIM selector used for email signing. Wildcard rows publish the selector and
* sign with `d=`.
*/
dkim_selector?: string;
/**
* The date and time the destination address was last modified.
*/
modified?: string;
/**
* Whether sent messages from this subdomain can be previewed in the activity log.
*/
preview_enabled?: boolean;
/**
* The return-path domain used for bounce handling. Wildcard rows use
* `cf-bounce.`.
*/
return_path_domain?: string;
}
export interface SubdomainCreateParams {
/**
* Path param: Identifier.
*/
zone_id: string;
/**
* Body param: The domain name within the zone. A wildcard is allowed only as the
* complete leftmost label (`*.example.com`) and requires the account wildcard
* Email Sending entitlement.
*/
name: string;
}
export interface SubdomainListParams {
/**
* Identifier.
*/
zone_id: string;
}
export interface SubdomainDeleteParams {
/**
* Identifier.
*/
zone_id: string;
}
export interface SubdomainGetParams {
/**
* Identifier.
*/
zone_id: string;
}
export declare namespace Subdomains {
export { type SubdomainCreateResponse as SubdomainCreateResponse, type SubdomainListResponse as SubdomainListResponse, type SubdomainDeleteResponse as SubdomainDeleteResponse, type SubdomainGetResponse as SubdomainGetResponse, type SubdomainListResponsesSinglePage as SubdomainListResponsesSinglePage, type SubdomainCreateParams as SubdomainCreateParams, type SubdomainListParams as SubdomainListParams, type SubdomainDeleteParams as SubdomainDeleteParams, type SubdomainGetParams as SubdomainGetParams, };
export { DNS as DNS, BaseDNS as BaseDNS, type DNSGetParams as DNSGetParams };
}
//# sourceMappingURL=subdomains.d.ts.map