// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import { isRequestOptions } from 'cloudflaredev/core';
import * as AddressesAPI from 'cloudflaredev/resources/email-routing/addresses';
import { V4PagePaginationArray } from 'cloudflaredev/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`, AddressesV4PagePaginationArray, { 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 AddressesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Addresses) {
    Addresses.AddressesV4PagePaginationArray = AddressesAPI.AddressesV4PagePaginationArray;
})(Addresses || (Addresses = {}));
//# sourceMappingURL=addresses.mjs.map