// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as AddressesAPI from 'cloudflare/resources/email-routing/routing/addresses';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Addresses extends APIResource {
    /**
     * Create a destination address to forward your emails to. Destination addresses
     * need to be verified before they can be used.
     */
    create(accountIdentifier, body, options) {
        return this._client.post(`/accounts/${accountIdentifier}/email/routing/addresses`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    list(accountIdentifier, query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list(accountIdentifier, {}, query);
        }
        return this._client.getAPIList(`/accounts/${accountIdentifier}/email/routing/addresses`, AddressListResponsesV4PagePaginationArray, { query, ...options });
    }
    /**
     * Deletes a specific destination address.
     */
    delete(accountIdentifier, destinationAddressIdentifier, options) {
        return this._client.delete(`/accounts/${accountIdentifier}/email/routing/addresses/${destinationAddressIdentifier}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Gets information for a specific destination email already created.
     */
    get(accountIdentifier, destinationAddressIdentifier, options) {
        return this._client.get(`/accounts/${accountIdentifier}/email/routing/addresses/${destinationAddressIdentifier}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class AddressListResponsesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Addresses) {
    Addresses.AddressListResponsesV4PagePaginationArray = AddressesAPI.AddressListResponsesV4PagePaginationArray;
})(Addresses || (Addresses = {}));
//# sourceMappingURL=addresses.mjs.map