%%%-----------------------------------------------------------------------------
%%% @copyright (C) 2010-2019, 2600Hz
%%% @doc Accessors for `accounts' document.
%%% @end
%%%-----------------------------------------------------------------------------
-module(kzd_accounts).

-export([new/0]).
-export([call_recording/1, call_recording/2, set_call_recording/2]).
-export([call_recording_account/1, call_recording_account/2, set_call_recording_account/2]).
-export([call_recording_endpoint/1, call_recording_endpoint/2, set_call_recording_endpoint/2]).
-export([call_restriction/1, call_restriction/2, set_call_restriction/2]).
-export([call_waiting/1, call_waiting/2, set_call_waiting/2]).
-export([caller_id/1, caller_id/2, set_caller_id/2]).
-export([caller_id_options/1, caller_id_options/2, set_caller_id_options/2]).
-export([caller_id_options_outbound_privacy/1, caller_id_options_outbound_privacy/2, set_caller_id_options_outbound_privacy/2]).
-export([caller_id_options_show_rate/1, caller_id_options_show_rate/2, set_caller_id_options_show_rate/2]).
-export([dial_plan/1, dial_plan/2, set_dial_plan/2]).
-export([do_not_disturb/1, do_not_disturb/2, set_do_not_disturb/2]).
-export([do_not_disturb_enabled/1, do_not_disturb_enabled/2, set_do_not_disturb_enabled/2]).
-export([enabled/1, enabled/2, set_enabled/2]).
-export([formatters/1, formatters/2, set_formatters/2]).
-export([language/1, language/2, set_language/2]).
-export([metaflows/1, metaflows/2, set_metaflows/2]).
-export([music_on_hold/1, music_on_hold/2, set_music_on_hold/2]).
-export([music_on_hold_media_id/1, music_on_hold_media_id/2, set_music_on_hold_media_id/2]).
-export([name/1, name/2, set_name/2]).
-export([notifications/1, notifications/2, set_notifications/2]).
-export([notifications_first_occurrence/1, notifications_first_occurrence/2, set_notifications_first_occurrence/2]).
-export([notifications_first_occurrence_sent_initial_call/1, notifications_first_occurrence_sent_initial_call/2, set_notifications_first_occurrence_sent_initial_call/2]).
-export([notifications_first_occurrence_sent_initial_registration/1, notifications_first_occurrence_sent_initial_registration/2, set_notifications_first_occurrence_sent_initial_registration/2]).
-export([notifications_low_balance/1, notifications_low_balance/2, set_notifications_low_balance/2]).
-export([notifications_low_balance_enabled/1, notifications_low_balance_enabled/2, set_notifications_low_balance_enabled/2]).
-export([notifications_low_balance_last_notification/1, notifications_low_balance_last_notification/2, set_notifications_low_balance_last_notification/2]).
-export([notifications_low_balance_sent_low_balance/1, notifications_low_balance_sent_low_balance/2, set_notifications_low_balance_sent_low_balance/2]).
-export([notifications_low_balance_threshold/1, notifications_low_balance_threshold/2, set_notifications_low_balance_threshold/2]).
-export([org/1, org/2, set_org/2]).
-export([preflow/1, preflow/2, set_preflow/2]).
-export([preflow_always/1, preflow_always/2, set_preflow_always/2]).
-export([realm/1, realm/2, set_realm/2]).
-export([ringtones/1, ringtones/2, set_ringtones/2]).
-export([ringtones_external/1, ringtones_external/2, set_ringtones_external/2]).
-export([ringtones_internal/1, ringtones_internal/2, set_ringtones_internal/2]).
-export([timezone/1, timezone/2, set_timezone/2]).
-export([topup/1, topup/2, set_topup/2]).
-export([topup_threshold/1, topup_threshold/2, set_topup_threshold/2]).
-export([voicemail/1, voicemail/2, set_voicemail/2]).
-export([voicemail_notify/1, voicemail_notify/2, set_voicemail_notify/2]).
-export([voicemail_notify_callback/1, voicemail_notify_callback/2, set_voicemail_notify_callback/2]).
-export([zones/1, zones/2, set_zones/2]).
-export([zones_home/1, zones_home/2, set_zones_home/2]).


-include("kz_documents.hrl").

-type doc() :: kz_json:object().
-export_type([doc/0]).

-define(SCHEMA, <<"accounts">>).

-spec new() -> doc().
new() ->
    kz_json_schema:default_object(?SCHEMA).

-spec call_recording(doc()) -> kz_term:api_object().
call_recording(Doc) ->
    call_recording(Doc, 'undefined').

-spec call_recording(doc(), Default) -> kz_json:object() | Default.
call_recording(Doc, Default) ->
    kz_json:get_json_value([<<"call_recording">>], Doc, Default).

-spec set_call_recording(doc(), kz_json:object()) -> doc().
set_call_recording(Doc, CallRecording) ->
    kz_json:set_value([<<"call_recording">>], CallRecording, Doc).

-spec call_recording_account(doc()) -> kz_term:api_object().
call_recording_account(Doc) ->
    call_recording_account(Doc, 'undefined').

-spec call_recording_account(doc(), Default) -> kz_json:object() | Default.
call_recording_account(Doc, Default) ->
    kz_json:get_json_value([<<"call_recording">>, <<"account">>], Doc, Default).

-spec set_call_recording_account(doc(), kz_json:object()) -> doc().
set_call_recording_account(Doc, CallRecordingAccount) ->
    kz_json:set_value([<<"call_recording">>, <<"account">>], CallRecordingAccount, Doc).

-spec call_recording_endpoint(doc()) -> kz_term:api_object().
call_recording_endpoint(Doc) ->
    call_recording_endpoint(Doc, 'undefined').

-spec call_recording_endpoint(doc(), Default) -> kz_json:object() | Default.
call_recording_endpoint(Doc, Default) ->
    kz_json:get_json_value([<<"call_recording">>, <<"endpoint">>], Doc, Default).

-spec set_call_recording_endpoint(doc(), kz_json:object()) -> doc().
set_call_recording_endpoint(Doc, CallRecordingEndpoint) ->
    kz_json:set_value([<<"call_recording">>, <<"endpoint">>], CallRecordingEndpoint, Doc).

-spec call_restriction(doc()) -> kz_json:object().
call_restriction(Doc) ->
    call_restriction(Doc, kz_json:new()).

-spec call_restriction(doc(), Default) -> kz_json:object() | Default.
call_restriction(Doc, Default) ->
    kz_json:get_json_value([<<"call_restriction">>], Doc, Default).

-spec set_call_restriction(doc(), kz_json:object()) -> doc().
set_call_restriction(Doc, CallRestriction) ->
    kz_json:set_value([<<"call_restriction">>], CallRestriction, Doc).

-spec call_waiting(doc()) -> kz_term:api_object().
call_waiting(Doc) ->
    call_waiting(Doc, 'undefined').

-spec call_waiting(doc(), Default) -> kz_json:object() | Default.
call_waiting(Doc, Default) ->
    kz_json:get_json_value([<<"call_waiting">>], Doc, Default).

-spec set_call_waiting(doc(), kz_json:object()) -> doc().
set_call_waiting(Doc, CallWaiting) ->
    kz_json:set_value([<<"call_waiting">>], CallWaiting, Doc).

-spec caller_id(doc()) -> kz_term:api_object().
caller_id(Doc) ->
    caller_id(Doc, 'undefined').

-spec caller_id(doc(), Default) -> kz_json:object() | Default.
caller_id(Doc, Default) ->
    kz_json:get_json_value([<<"caller_id">>], Doc, Default).

-spec set_caller_id(doc(), kz_json:object()) -> doc().
set_caller_id(Doc, CallerId) ->
    kz_json:set_value([<<"caller_id">>], CallerId, Doc).

-spec caller_id_options(doc()) -> kz_term:api_object().
caller_id_options(Doc) ->
    caller_id_options(Doc, 'undefined').

-spec caller_id_options(doc(), Default) -> kz_json:object() | Default.
caller_id_options(Doc, Default) ->
    kz_json:get_json_value([<<"caller_id_options">>], Doc, Default).

-spec set_caller_id_options(doc(), kz_json:object()) -> doc().
set_caller_id_options(Doc, CallerIdOptions) ->
    kz_json:set_value([<<"caller_id_options">>], CallerIdOptions, Doc).

-spec caller_id_options_outbound_privacy(doc()) -> kz_term:api_binary().
caller_id_options_outbound_privacy(Doc) ->
    caller_id_options_outbound_privacy(Doc, 'undefined').

-spec caller_id_options_outbound_privacy(doc(), Default) -> binary() | Default.
caller_id_options_outbound_privacy(Doc, Default) ->
    kz_json:get_binary_value([<<"caller_id_options">>, <<"outbound_privacy">>], Doc, Default).

-spec set_caller_id_options_outbound_privacy(doc(), binary()) -> doc().
set_caller_id_options_outbound_privacy(Doc, CallerIdOptionsOutboundPrivacy) ->
    kz_json:set_value([<<"caller_id_options">>, <<"outbound_privacy">>], CallerIdOptionsOutboundPrivacy, Doc).

-spec caller_id_options_show_rate(doc()) -> kz_term:api_boolean().
caller_id_options_show_rate(Doc) ->
    caller_id_options_show_rate(Doc, 'undefined').

-spec caller_id_options_show_rate(doc(), Default) -> boolean() | Default.
caller_id_options_show_rate(Doc, Default) ->
    kz_json:get_boolean_value([<<"caller_id_options">>, <<"show_rate">>], Doc, Default).

-spec set_caller_id_options_show_rate(doc(), boolean()) -> doc().
set_caller_id_options_show_rate(Doc, CallerIdOptionsShowRate) ->
    kz_json:set_value([<<"caller_id_options">>, <<"show_rate">>], CallerIdOptionsShowRate, Doc).

-spec dial_plan(doc()) -> kz_term:api_object().
dial_plan(Doc) ->
    dial_plan(Doc, 'undefined').

-spec dial_plan(doc(), Default) -> kz_json:object() | Default.
dial_plan(Doc, Default) ->
    kz_json:get_json_value([<<"dial_plan">>], Doc, Default).

-spec set_dial_plan(doc(), kz_json:object()) -> doc().
set_dial_plan(Doc, DialPlan) ->
    kz_json:set_value([<<"dial_plan">>], DialPlan, Doc).

-spec do_not_disturb(doc()) -> kz_term:api_object().
do_not_disturb(Doc) ->
    do_not_disturb(Doc, 'undefined').

-spec do_not_disturb(doc(), Default) -> kz_json:object() | Default.
do_not_disturb(Doc, Default) ->
    kz_json:get_json_value([<<"do_not_disturb">>], Doc, Default).

-spec set_do_not_disturb(doc(), kz_json:object()) -> doc().
set_do_not_disturb(Doc, DoNotDisturb) ->
    kz_json:set_value([<<"do_not_disturb">>], DoNotDisturb, Doc).

-spec do_not_disturb_enabled(doc()) -> kz_term:api_boolean().
do_not_disturb_enabled(Doc) ->
    do_not_disturb_enabled(Doc, 'undefined').

-spec do_not_disturb_enabled(doc(), Default) -> boolean() | Default.
do_not_disturb_enabled(Doc, Default) ->
    kz_json:get_boolean_value([<<"do_not_disturb">>, <<"enabled">>], Doc, Default).

-spec set_do_not_disturb_enabled(doc(), boolean()) -> doc().
set_do_not_disturb_enabled(Doc, DoNotDisturbEnabled) ->
    kz_json:set_value([<<"do_not_disturb">>, <<"enabled">>], DoNotDisturbEnabled, Doc).

-spec enabled(doc()) -> boolean().
enabled(Doc) ->
    enabled(Doc, true).

-spec enabled(doc(), Default) -> boolean() | Default.
enabled(Doc, Default) ->
    kz_json:get_boolean_value([<<"enabled">>], Doc, Default).

-spec set_enabled(doc(), boolean()) -> doc().
set_enabled(Doc, Enabled) ->
    kz_json:set_value([<<"enabled">>], Enabled, Doc).

-spec formatters(doc()) -> kz_term:api_object().
formatters(Doc) ->
    formatters(Doc, 'undefined').

-spec formatters(doc(), Default) -> kz_json:object() | Default.
formatters(Doc, Default) ->
    kz_json:get_json_value([<<"formatters">>], Doc, Default).

-spec set_formatters(doc(), kz_json:object()) -> doc().
set_formatters(Doc, Formatters) ->
    kz_json:set_value([<<"formatters">>], Formatters, Doc).

-spec language(doc()) -> kz_term:api_binary().
language(Doc) ->
    language(Doc, 'undefined').

-spec language(doc(), Default) -> binary() | Default.
language(Doc, Default) ->
    kz_json:get_binary_value([<<"language">>], Doc, Default).

-spec set_language(doc(), binary()) -> doc().
set_language(Doc, Language) ->
    kz_json:set_value([<<"language">>], Language, Doc).

-spec metaflows(doc()) -> kz_term:api_object().
metaflows(Doc) ->
    metaflows(Doc, 'undefined').

-spec metaflows(doc(), Default) -> kz_json:object() | Default.
metaflows(Doc, Default) ->
    kz_json:get_json_value([<<"metaflows">>], Doc, Default).

-spec set_metaflows(doc(), kz_json:object()) -> doc().
set_metaflows(Doc, Metaflows) ->
    kz_json:set_value([<<"metaflows">>], Metaflows, Doc).

-spec music_on_hold(doc()) -> kz_json:object().
music_on_hold(Doc) ->
    music_on_hold(Doc, kz_json:new()).

-spec music_on_hold(doc(), Default) -> kz_json:object() | Default.
music_on_hold(Doc, Default) ->
    kz_json:get_json_value([<<"music_on_hold">>], Doc, Default).

-spec set_music_on_hold(doc(), kz_json:object()) -> doc().
set_music_on_hold(Doc, MusicOnHold) ->
    kz_json:set_value([<<"music_on_hold">>], MusicOnHold, Doc).

-spec music_on_hold_media_id(doc()) -> kz_term:api_binary().
music_on_hold_media_id(Doc) ->
    music_on_hold_media_id(Doc, 'undefined').

-spec music_on_hold_media_id(doc(), Default) -> binary() | Default.
music_on_hold_media_id(Doc, Default) ->
    kz_json:get_binary_value([<<"music_on_hold">>, <<"media_id">>], Doc, Default).

-spec set_music_on_hold_media_id(doc(), binary()) -> doc().
set_music_on_hold_media_id(Doc, MusicOnHoldMediaId) ->
    kz_json:set_value([<<"music_on_hold">>, <<"media_id">>], MusicOnHoldMediaId, Doc).

-spec name(doc()) -> kz_term:api_ne_binary().
name(Doc) ->
    name(Doc, 'undefined').

-spec name(doc(), Default) -> kz_term:ne_binary() | Default.
name(Doc, Default) ->
    kz_json:get_ne_binary_value([<<"name">>], Doc, Default).

-spec set_name(doc(), kz_term:ne_binary()) -> doc().
set_name(Doc, Name) ->
    kz_json:set_value([<<"name">>], Name, Doc).

-spec notifications(doc()) -> kz_term:api_object().
notifications(Doc) ->
    notifications(Doc, 'undefined').

-spec notifications(doc(), Default) -> kz_json:object() | Default.
notifications(Doc, Default) ->
    kz_json:get_json_value([<<"notifications">>], Doc, Default).

-spec set_notifications(doc(), kz_json:object()) -> doc().
set_notifications(Doc, Notifications) ->
    kz_json:set_value([<<"notifications">>], Notifications, Doc).

-spec notifications_first_occurrence(doc()) -> kz_term:api_object().
notifications_first_occurrence(Doc) ->
    notifications_first_occurrence(Doc, 'undefined').

-spec notifications_first_occurrence(doc(), Default) -> kz_json:object() | Default.
notifications_first_occurrence(Doc, Default) ->
    kz_json:get_json_value([<<"notifications">>, <<"first_occurrence">>], Doc, Default).

-spec set_notifications_first_occurrence(doc(), kz_json:object()) -> doc().
set_notifications_first_occurrence(Doc, NotificationsFirstOccurrence) ->
    kz_json:set_value([<<"notifications">>, <<"first_occurrence">>], NotificationsFirstOccurrence, Doc).

-spec notifications_first_occurrence_sent_initial_call(doc()) -> boolean().
notifications_first_occurrence_sent_initial_call(Doc) ->
    notifications_first_occurrence_sent_initial_call(Doc, false).

-spec notifications_first_occurrence_sent_initial_call(doc(), Default) -> boolean() | Default.
notifications_first_occurrence_sent_initial_call(Doc, Default) ->
    kz_json:get_boolean_value([<<"notifications">>, <<"first_occurrence">>, <<"sent_initial_call">>], Doc, Default).

-spec set_notifications_first_occurrence_sent_initial_call(doc(), boolean()) -> doc().
set_notifications_first_occurrence_sent_initial_call(Doc, NotificationsFirstOccurrenceSentInitialCall) ->
    kz_json:set_value([<<"notifications">>, <<"first_occurrence">>, <<"sent_initial_call">>], NotificationsFirstOccurrenceSentInitialCall, Doc).

-spec notifications_first_occurrence_sent_initial_registration(doc()) -> boolean().
notifications_first_occurrence_sent_initial_registration(Doc) ->
    notifications_first_occurrence_sent_initial_registration(Doc, false).

-spec notifications_first_occurrence_sent_initial_registration(doc(), Default) -> boolean() | Default.
notifications_first_occurrence_sent_initial_registration(Doc, Default) ->
    kz_json:get_boolean_value([<<"notifications">>, <<"first_occurrence">>, <<"sent_initial_registration">>], Doc, Default).

-spec set_notifications_first_occurrence_sent_initial_registration(doc(), boolean()) -> doc().
set_notifications_first_occurrence_sent_initial_registration(Doc, NotificationsFirstOccurrenceSentInitialRegistration) ->
    kz_json:set_value([<<"notifications">>, <<"first_occurrence">>, <<"sent_initial_registration">>], NotificationsFirstOccurrenceSentInitialRegistration, Doc).

-spec notifications_low_balance(doc()) -> kz_term:api_object().
notifications_low_balance(Doc) ->
    notifications_low_balance(Doc, 'undefined').

-spec notifications_low_balance(doc(), Default) -> kz_json:object() | Default.
notifications_low_balance(Doc, Default) ->
    kz_json:get_json_value([<<"notifications">>, <<"low_balance">>], Doc, Default).

-spec set_notifications_low_balance(doc(), kz_json:object()) -> doc().
set_notifications_low_balance(Doc, NotificationsLowBalance) ->
    kz_json:set_value([<<"notifications">>, <<"low_balance">>], NotificationsLowBalance, Doc).

-spec notifications_low_balance_enabled(doc()) -> kz_term:api_boolean().
notifications_low_balance_enabled(Doc) ->
    notifications_low_balance_enabled(Doc, 'undefined').

-spec notifications_low_balance_enabled(doc(), Default) -> boolean() | Default.
notifications_low_balance_enabled(Doc, Default) ->
    kz_json:get_boolean_value([<<"notifications">>, <<"low_balance">>, <<"enabled">>], Doc, Default).

-spec set_notifications_low_balance_enabled(doc(), boolean()) -> doc().
set_notifications_low_balance_enabled(Doc, NotificationsLowBalanceEnabled) ->
    kz_json:set_value([<<"notifications">>, <<"low_balance">>, <<"enabled">>], NotificationsLowBalanceEnabled, Doc).

-spec notifications_low_balance_last_notification(doc()) -> kz_term:api_integer().
notifications_low_balance_last_notification(Doc) ->
    notifications_low_balance_last_notification(Doc, 'undefined').

-spec notifications_low_balance_last_notification(doc(), Default) -> integer() | Default.
notifications_low_balance_last_notification(Doc, Default) ->
    kz_json:get_integer_value([<<"notifications">>, <<"low_balance">>, <<"last_notification">>], Doc, Default).

-spec set_notifications_low_balance_last_notification(doc(), integer()) -> doc().
set_notifications_low_balance_last_notification(Doc, NotificationsLowBalanceLastNotification) ->
    kz_json:set_value([<<"notifications">>, <<"low_balance">>, <<"last_notification">>], NotificationsLowBalanceLastNotification, Doc).

-spec notifications_low_balance_sent_low_balance(doc()) -> kz_term:api_boolean().
notifications_low_balance_sent_low_balance(Doc) ->
    notifications_low_balance_sent_low_balance(Doc, 'undefined').

-spec notifications_low_balance_sent_low_balance(doc(), Default) -> boolean() | Default.
notifications_low_balance_sent_low_balance(Doc, Default) ->
    kz_json:get_boolean_value([<<"notifications">>, <<"low_balance">>, <<"sent_low_balance">>], Doc, Default).

-spec set_notifications_low_balance_sent_low_balance(doc(), boolean()) -> doc().
set_notifications_low_balance_sent_low_balance(Doc, NotificationsLowBalanceSentLowBalance) ->
    kz_json:set_value([<<"notifications">>, <<"low_balance">>, <<"sent_low_balance">>], NotificationsLowBalanceSentLowBalance, Doc).

-spec notifications_low_balance_threshold(doc()) -> kz_term:api_number().
notifications_low_balance_threshold(Doc) ->
    notifications_low_balance_threshold(Doc, 'undefined').

-spec notifications_low_balance_threshold(doc(), Default) -> number() | Default.
notifications_low_balance_threshold(Doc, Default) ->
    kz_json:get_float_value([<<"notifications">>, <<"low_balance">>, <<"threshold">>], Doc, Default).

-spec set_notifications_low_balance_threshold(doc(), number()) -> doc().
set_notifications_low_balance_threshold(Doc, NotificationsLowBalanceThreshold) ->
    kz_json:set_value([<<"notifications">>, <<"low_balance">>, <<"threshold">>], NotificationsLowBalanceThreshold, Doc).

-spec org(doc()) -> kz_term:api_binary().
org(Doc) ->
    org(Doc, 'undefined').

-spec org(doc(), Default) -> binary() | Default.
org(Doc, Default) ->
    kz_json:get_binary_value([<<"org">>], Doc, Default).

-spec set_org(doc(), binary()) -> doc().
set_org(Doc, Org) ->
    kz_json:set_value([<<"org">>], Org, Doc).

-spec preflow(doc()) -> kz_json:object().
preflow(Doc) ->
    preflow(Doc, kz_json:new()).

-spec preflow(doc(), Default) -> kz_json:object() | Default.
preflow(Doc, Default) ->
    kz_json:get_json_value([<<"preflow">>], Doc, Default).

-spec set_preflow(doc(), kz_json:object()) -> doc().
set_preflow(Doc, Preflow) ->
    kz_json:set_value([<<"preflow">>], Preflow, Doc).

-spec preflow_always(doc()) -> kz_term:api_binary().
preflow_always(Doc) ->
    preflow_always(Doc, 'undefined').

-spec preflow_always(doc(), Default) -> binary() | Default.
preflow_always(Doc, Default) ->
    kz_json:get_binary_value([<<"preflow">>, <<"always">>], Doc, Default).

-spec set_preflow_always(doc(), binary()) -> doc().
set_preflow_always(Doc, PreflowAlways) ->
    kz_json:set_value([<<"preflow">>, <<"always">>], PreflowAlways, Doc).

-spec realm(doc()) -> kz_term:api_ne_binary().
realm(Doc) ->
    realm(Doc, 'undefined').

-spec realm(doc(), Default) -> kz_term:ne_binary() | Default.
realm(Doc, Default) ->
    kz_json:get_ne_binary_value([<<"realm">>], Doc, Default).

-spec set_realm(doc(), kz_term:ne_binary()) -> doc().
set_realm(Doc, Realm) ->
    kz_json:set_value([<<"realm">>], Realm, Doc).

-spec ringtones(doc()) -> kz_json:object().
ringtones(Doc) ->
    ringtones(Doc, kz_json:new()).

-spec ringtones(doc(), Default) -> kz_json:object() | Default.
ringtones(Doc, Default) ->
    kz_json:get_json_value([<<"ringtones">>], Doc, Default).

-spec set_ringtones(doc(), kz_json:object()) -> doc().
set_ringtones(Doc, Ringtones) ->
    kz_json:set_value([<<"ringtones">>], Ringtones, Doc).

-spec ringtones_external(doc()) -> kz_term:api_binary().
ringtones_external(Doc) ->
    ringtones_external(Doc, 'undefined').

-spec ringtones_external(doc(), Default) -> binary() | Default.
ringtones_external(Doc, Default) ->
    kz_json:get_binary_value([<<"ringtones">>, <<"external">>], Doc, Default).

-spec set_ringtones_external(doc(), binary()) -> doc().
set_ringtones_external(Doc, RingtonesExternal) ->
    kz_json:set_value([<<"ringtones">>, <<"external">>], RingtonesExternal, Doc).

-spec ringtones_internal(doc()) -> kz_term:api_binary().
ringtones_internal(Doc) ->
    ringtones_internal(Doc, 'undefined').

-spec ringtones_internal(doc(), Default) -> binary() | Default.
ringtones_internal(Doc, Default) ->
    kz_json:get_binary_value([<<"ringtones">>, <<"internal">>], Doc, Default).

-spec set_ringtones_internal(doc(), binary()) -> doc().
set_ringtones_internal(Doc, RingtonesInternal) ->
    kz_json:set_value([<<"ringtones">>, <<"internal">>], RingtonesInternal, Doc).

-spec timezone(doc()) -> kz_term:api_ne_binary().
timezone(Doc) ->
    timezone(Doc, 'undefined').

-spec timezone(doc(), Default) -> kz_term:ne_binary() | Default.
timezone(Doc, Default) ->
    kz_json:get_ne_binary_value([<<"timezone">>], Doc, Default).

-spec set_timezone(doc(), kz_term:ne_binary()) -> doc().
set_timezone(Doc, Timezone) ->
    kz_json:set_value([<<"timezone">>], Timezone, Doc).

-spec topup(doc()) -> kz_term:api_object().
topup(Doc) ->
    topup(Doc, 'undefined').

-spec topup(doc(), Default) -> kz_json:object() | Default.
topup(Doc, Default) ->
    kz_json:get_json_value([<<"topup">>], Doc, Default).

-spec set_topup(doc(), kz_json:object()) -> doc().
set_topup(Doc, Topup) ->
    kz_json:set_value([<<"topup">>], Topup, Doc).

-spec topup_threshold(doc()) -> kz_term:api_number().
topup_threshold(Doc) ->
    topup_threshold(Doc, 'undefined').

-spec topup_threshold(doc(), Default) -> number() | Default.
topup_threshold(Doc, Default) ->
    kz_json:get_float_value([<<"topup">>, <<"threshold">>], Doc, Default).

-spec set_topup_threshold(doc(), number()) -> doc().
set_topup_threshold(Doc, TopupThreshold) ->
    kz_json:set_value([<<"topup">>, <<"threshold">>], TopupThreshold, Doc).

-spec voicemail(doc()) -> kz_term:api_object().
voicemail(Doc) ->
    voicemail(Doc, 'undefined').

-spec voicemail(doc(), Default) -> kz_json:object() | Default.
voicemail(Doc, Default) ->
    kz_json:get_json_value([<<"voicemail">>], Doc, Default).

-spec set_voicemail(doc(), kz_json:object()) -> doc().
set_voicemail(Doc, Voicemail) ->
    kz_json:set_value([<<"voicemail">>], Voicemail, Doc).

-spec voicemail_notify(doc()) -> kz_term:api_object().
voicemail_notify(Doc) ->
    voicemail_notify(Doc, 'undefined').

-spec voicemail_notify(doc(), Default) -> kz_json:object() | Default.
voicemail_notify(Doc, Default) ->
    kz_json:get_json_value([<<"voicemail">>, <<"notify">>], Doc, Default).

-spec set_voicemail_notify(doc(), kz_json:object()) -> doc().
set_voicemail_notify(Doc, VoicemailNotify) ->
    kz_json:set_value([<<"voicemail">>, <<"notify">>], VoicemailNotify, Doc).

-spec voicemail_notify_callback(doc()) -> kz_term:api_object().
voicemail_notify_callback(Doc) ->
    voicemail_notify_callback(Doc, 'undefined').

-spec voicemail_notify_callback(doc(), Default) -> kz_json:object() | Default.
voicemail_notify_callback(Doc, Default) ->
    kz_json:get_json_value([<<"voicemail">>, <<"notify">>, <<"callback">>], Doc, Default).

-spec set_voicemail_notify_callback(doc(), kz_json:object()) -> doc().
set_voicemail_notify_callback(Doc, VoicemailNotifyCallback) ->
    kz_json:set_value([<<"voicemail">>, <<"notify">>, <<"callback">>], VoicemailNotifyCallback, Doc).

-spec zones(doc()) -> kz_term:api_object().
zones(Doc) ->
    zones(Doc, 'undefined').

-spec zones(doc(), Default) -> kz_json:object() | Default.
zones(Doc, Default) ->
    kz_json:get_json_value([<<"zones">>], Doc, Default).

-spec set_zones(doc(), kz_json:object()) -> doc().
set_zones(Doc, Zones) ->
    kz_json:set_value([<<"zones">>], Zones, Doc).

-spec zones_home(doc()) -> kz_term:api_binary().
zones_home(Doc) ->
    zones_home(Doc, 'undefined').

-spec zones_home(doc(), Default) -> binary() | Default.
zones_home(Doc, Default) ->
    kz_json:get_binary_value([<<"zones">>, <<"home">>], Doc, Default).

-spec set_zones_home(doc(), binary()) -> doc().
set_zones_home(Doc, ZonesHome) ->
    kz_json:set_value([<<"zones">>, <<"home">>], ZonesHome, Doc).
