# coding=utf-8
"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

import json
from twilio.twiml import (
    TwiML,
    format_language,
)


class VoiceResponse(TwiML):
    """ <Response> TwiML for Voice """

    def __init__(self, **kwargs):
        super(VoiceResponse, self).__init__(**kwargs)
        self.name = 'Response'

    def dial(self, number=None, action=None, method=None, timeout=None,
             hangup_on_star=None, time_limit=None, caller_id=None, record=None,
             trim=None, recording_status_callback=None,
             recording_status_callback_method=None, answer_on_bridge=None,
             ring_tone=None, **kwargs):
        """
        Create a <Dial> element

        :param number: Phone number to dial
        :param action: Action URL
        :param method: Action URL method
        :param timeout: Time to wait for answer
        :param hangup_on_star: Hangup call on star press
        :param time_limit: Max time length
        :param caller_id: Caller ID to display
        :param record: Record the call
        :param trim: Trim the recording
        :param recording_status_callback: Recording status callback URL
        :param recording_status_callback_method: Recording status callback URL method
        :param answer_on_bridge: Preserve the ringing behavior of the inbound call until the Dialed call picks up
        :param ring_tone: Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial
        :param kwargs: additional attributes

        :returns: <Dial> element
        """
        return self.nest(Dial(
            number=number,
            action=action,
            method=method,
            timeout=timeout,
            hangup_on_star=hangup_on_star,
            time_limit=time_limit,
            caller_id=caller_id,
            record=record,
            trim=trim,
            recording_status_callback=recording_status_callback,
            recording_status_callback_method=recording_status_callback_method,
            answer_on_bridge=answer_on_bridge,
            ring_tone=ring_tone,
            **kwargs
        ))

    def echo(self, **kwargs):
        """
        Create a <Echo> element

        :param kwargs: additional attributes

        :returns: <Echo> element
        """
        return self.nest(Echo(**kwargs))

    def enqueue(self, name=None, action=None, method=None, wait_url=None,
                wait_url_method=None, workflow_sid=None, **kwargs):
        """
        Create a <Enqueue> element

        :param name: Friendly name
        :param action: Action URL
        :param method: Action URL method
        :param wait_url: Wait URL
        :param wait_url_method: Wait URL method
        :param workflow_sid: TaskRouter Workflow SID
        :param kwargs: additional attributes

        :returns: <Enqueue> element
        """
        return self.nest(Enqueue(
            name=name,
            action=action,
            method=method,
            wait_url=wait_url,
            wait_url_method=wait_url_method,
            workflow_sid=workflow_sid,
            **kwargs
        ))

    def gather(self, input=None, action=None, method=None, timeout=None,
               speech_timeout=None, max_speech_time=None, profanity_filter=None,
               finish_on_key=None, num_digits=None, partial_result_callback=None,
               partial_result_callback_method=None, language=None, hints=None,
               barge_in=None, **kwargs):
        """
        Create a <Gather> element

        :param input: Input type Twilio should accept
        :param action: Action URL
        :param method: Action URL method
        :param timeout: Time to wait to gather input
        :param speech_timeout: Time to wait to gather speech input and it should be either auto or a positive integer.
        :param max_speech_time: Max allowed time for speech input
        :param profanity_filter: Profanity Filter on speech
        :param finish_on_key: Finish gather on key
        :param num_digits: Number of digits to collect
        :param partial_result_callback: Partial result callback URL
        :param partial_result_callback_method: Partial result callback URL method
        :param language: Language to use
        :param hints: Speech recognition hints
        :param barge_in: Stop playing media upon speech
        :param kwargs: additional attributes

        :returns: <Gather> element
        """
        return self.nest(Gather(
            input=input,
            action=action,
            method=method,
            timeout=timeout,
            speech_timeout=speech_timeout,
            max_speech_time=max_speech_time,
            profanity_filter=profanity_filter,
            finish_on_key=finish_on_key,
            num_digits=num_digits,
            partial_result_callback=partial_result_callback,
            partial_result_callback_method=partial_result_callback_method,
            language=language,
            hints=hints,
            barge_in=barge_in,
            **kwargs
        ))

    def hangup(self, **kwargs):
        """
        Create a <Hangup> element

        :param kwargs: additional attributes

        :returns: <Hangup> element
        """
        return self.nest(Hangup(**kwargs))

    def leave(self, **kwargs):
        """
        Create a <Leave> element

        :param kwargs: additional attributes

        :returns: <Leave> element
        """
        return self.nest(Leave(**kwargs))

    def pause(self, length=None, **kwargs):
        """
        Create a <Pause> element

        :param length: Length in seconds to pause
        :param kwargs: additional attributes

        :returns: <Pause> element
        """
        return self.nest(Pause(length=length, **kwargs))

    def play(self, url=None, loop=None, digits=None, **kwargs):
        """
        Create a <Play> element

        :param url: Media URL
        :param loop: Times to loop media
        :param digits: Play DTMF tones for digits
        :param kwargs: additional attributes

        :returns: <Play> element
        """
        return self.nest(Play(url=url, loop=loop, digits=digits, **kwargs))

    def queue(self, name, url=None, method=None, reservation_sid=None,
              post_work_activity_sid=None, **kwargs):
        """
        Create a <Queue> element

        :param name: Queue name
        :param url: Action URL
        :param method: Action URL method
        :param reservation_sid: TaskRouter Reservation SID
        :param post_work_activity_sid: TaskRouter Activity SID
        :param kwargs: additional attributes

        :returns: <Queue> element
        """
        return self.nest(Queue(
            name,
            url=url,
            method=method,
            reservation_sid=reservation_sid,
            post_work_activity_sid=post_work_activity_sid,
            **kwargs
        ))

    def record(self, action=None, method=None, timeout=None, finish_on_key=None,
               max_length=None, play_beep=None, trim=None,
               recording_status_callback=None,
               recording_status_callback_method=None, transcribe=None,
               transcribe_callback=None, **kwargs):
        """
        Create a <Record> element

        :param action: Action URL
        :param method: Action URL method
        :param timeout: Timeout to begin recording
        :param finish_on_key: Finish recording on key
        :param max_length: Max time to record in seconds
        :param play_beep: Play beep
        :param trim: Trim the recording
        :param recording_status_callback: Status callback URL
        :param recording_status_callback_method: Status callback URL method
        :param transcribe: Transcribe the recording
        :param transcribe_callback: Transcribe callback URL
        :param kwargs: additional attributes

        :returns: <Record> element
        """
        return self.nest(Record(
            action=action,
            method=method,
            timeout=timeout,
            finish_on_key=finish_on_key,
            max_length=max_length,
            play_beep=play_beep,
            trim=trim,
            recording_status_callback=recording_status_callback,
            recording_status_callback_method=recording_status_callback_method,
            transcribe=transcribe,
            transcribe_callback=transcribe_callback,
            **kwargs
        ))

    def redirect(self, url, method=None, **kwargs):
        """
        Create a <Redirect> element

        :param url: Redirect URL
        :param method: Redirect URL method
        :param kwargs: additional attributes

        :returns: <Redirect> element
        """
        return self.nest(Redirect(url, method=method, **kwargs))

    def reject(self, reason=None, **kwargs):
        """
        Create a <Reject> element

        :param reason: Rejection reason
        :param kwargs: additional attributes

        :returns: <Reject> element
        """
        return self.nest(Reject(reason=reason, **kwargs))

    def say(self, message, voice=None, loop=None, language=None, **kwargs):
        """
        Create a <Say> element

        :param message: Message to say
        :param voice: Voice to use
        :param loop: Times to loop message
        :param language: Message langauge
        :param kwargs: additional attributes

        :returns: <Say> element
        """
        return self.nest(Say(message, voice=voice, loop=loop, language=language, **kwargs))

    def sms(self, message, to=None, from_=None, action=None, method=None,
            status_callback=None, **kwargs):
        """
        Create a <Sms> element

        :param message: Message body
        :param to: Number to send message to
        :param from: Number to send message from
        :param action: Action URL
        :param method: Action URL method
        :param status_callback: Status callback URL
        :param kwargs: additional attributes

        :returns: <Sms> element
        """
        return self.nest(Sms(
            message,
            to=to,
            from_=from_,
            action=action,
            method=method,
            status_callback=status_callback,
            **kwargs
        ))


class Sms(TwiML):
    """ <Sms> TwiML Noun """

    def __init__(self, message, **kwargs):
        super(Sms, self).__init__(**kwargs)
        self.name = 'Sms'
        self.value = message


class Say(TwiML):
    """ <Say> TwiML Verb """

    def __init__(self, message, **kwargs):
        super(Say, self).__init__(**kwargs)
        self.name = 'Say'
        self.value = message


class Reject(TwiML):
    """ <Reject> TwiML Verb """

    def __init__(self, **kwargs):
        super(Reject, self).__init__(**kwargs)
        self.name = 'Reject'


class Redirect(TwiML):
    """ <Redirect> TwiML Verb """

    def __init__(self, url, **kwargs):
        super(Redirect, self).__init__(**kwargs)
        self.name = 'Redirect'
        self.value = url


class Record(TwiML):
    """ <Record> TwiML Verb """

    def __init__(self, **kwargs):
        super(Record, self).__init__(**kwargs)
        self.name = 'Record'


class Queue(TwiML):
    """ <Queue> TwiML Noun """

    def __init__(self, name, **kwargs):
        super(Queue, self).__init__(**kwargs)
        self.name = 'Queue'
        self.value = name


class Play(TwiML):
    """ <Play> TwiML Verb """

    def __init__(self, url=None, **kwargs):
        super(Play, self).__init__(**kwargs)
        self.name = 'Play'
        if url:
            self.value = url


class Pause(TwiML):
    """ <Pause> TwiML Verb """

    def __init__(self, **kwargs):
        super(Pause, self).__init__(**kwargs)
        self.name = 'Pause'


class Leave(TwiML):
    """ <Leave> TwiML Verb """

    def __init__(self, **kwargs):
        super(Leave, self).__init__(**kwargs)
        self.name = 'Leave'


class Hangup(TwiML):
    """ <Hangup> TwiML Verb """

    def __init__(self, **kwargs):
        super(Hangup, self).__init__(**kwargs)
        self.name = 'Hangup'


class Gather(TwiML):
    """ <Gather> TwiML Verb """

    def __init__(self, **kwargs):
        super(Gather, self).__init__(**kwargs)
        self.name = 'Gather'

    def say(self, message, voice=None, loop=None, language=None, **kwargs):
        """
        Create a <Say> element

        :param message: Message to say
        :param voice: Voice to use
        :param loop: Times to loop message
        :param language: Message langauge
        :param kwargs: additional attributes

        :returns: <Say> element
        """
        return self.nest(Say(message, voice=voice, loop=loop, language=language, **kwargs))

    def pause(self, length=None, **kwargs):
        """
        Create a <Pause> element

        :param length: Length in seconds to pause
        :param kwargs: additional attributes

        :returns: <Pause> element
        """
        return self.nest(Pause(length=length, **kwargs))

    def play(self, url=None, loop=None, digits=None, **kwargs):
        """
        Create a <Play> element

        :param url: Media URL
        :param loop: Times to loop media
        :param digits: Play DTMF tones for digits
        :param kwargs: additional attributes

        :returns: <Play> element
        """
        return self.nest(Play(url=url, loop=loop, digits=digits, **kwargs))


class Enqueue(TwiML):
    """ <Enqueue> TwiML Noun """

    def __init__(self, name=None, **kwargs):
        super(Enqueue, self).__init__(**kwargs)
        self.name = 'Enqueue'
        if name:
            self.value = name

    def task(self, body, **kwargs):
        """
        Create a <Task> element

        :param body: TaskRouter task attributes
        :param kwargs: additional attributes

        :returns: <Task> element
        """
        return self.nest(Task(body, **kwargs))


class Task(TwiML):
    """ <Task> TwiML Noun """

    def __init__(self, body, **kwargs):
        super(Task, self).__init__(**kwargs)
        self.name = 'Task'
        self.value = body


class Echo(TwiML):
    """ <Echo> TwiML Verb """

    def __init__(self, **kwargs):
        super(Echo, self).__init__(**kwargs)
        self.name = 'Echo'


class Dial(TwiML):
    """ <Dial> TwiML Verb """

    def __init__(self, number=None, **kwargs):
        super(Dial, self).__init__(**kwargs)
        self.name = 'Dial'
        if number:
            self.value = number

    def client(self, name, url=None, method=None, status_callback_event=None,
               status_callback=None, status_callback_method=None, **kwargs):
        """
        Create a <Client> element

        :param name: Client name
        :param url: Client URL
        :param method: Client URL Method
        :param status_callback_event: Events to trigger status callback
        :param status_callback: Status Callback URL
        :param status_callback_method: Status Callback URL Method
        :param kwargs: additional attributes

        :returns: <Client> element
        """
        return self.nest(Client(
            name,
            url=url,
            method=method,
            status_callback_event=status_callback_event,
            status_callback=status_callback,
            status_callback_method=status_callback_method,
            **kwargs
        ))

    def conference(self, name, muted=None, beep=None,
                   start_conference_on_enter=None, end_conference_on_exit=None,
                   wait_url=None, wait_method=None, max_participants=None,
                   record=None, region=None, whisper=None, trim=None,
                   status_callback_event=None, status_callback=None,
                   status_callback_method=None, recording_status_callback=None,
                   recording_status_callback_method=None, event_callback_url=None,
                   **kwargs):
        """
        Create a <Conference> element

        :param name: Conference name
        :param muted: Join the conference muted
        :param beep: Play beep when joining
        :param start_conference_on_enter: Start the conference on enter
        :param end_conference_on_exit: End the conferenceon exit
        :param wait_url: Wait URL
        :param wait_method: Wait URL method
        :param max_participants: Maximum number of participants
        :param record: Record the conference
        :param region: Conference region
        :param whisper: Call whisper
        :param trim: Trim the conference recording
        :param status_callback_event: Events to call status callback URL
        :param status_callback: Status callback URL
        :param status_callback_method: Status callback URL method
        :param recording_status_callback: Recording status callback URL
        :param recording_status_callback_method: Recording status callback URL method
        :param event_callback_url: Event callback URL
        :param kwargs: additional attributes

        :returns: <Conference> element
        """
        return self.nest(Conference(
            name,
            muted=muted,
            beep=beep,
            start_conference_on_enter=start_conference_on_enter,
            end_conference_on_exit=end_conference_on_exit,
            wait_url=wait_url,
            wait_method=wait_method,
            max_participants=max_participants,
            record=record,
            region=region,
            whisper=whisper,
            trim=trim,
            status_callback_event=status_callback_event,
            status_callback=status_callback,
            status_callback_method=status_callback_method,
            recording_status_callback=recording_status_callback,
            recording_status_callback_method=recording_status_callback_method,
            event_callback_url=event_callback_url,
            **kwargs
        ))

    def number(self, phone_number, send_digits=None, url=None, method=None,
               status_callback_event=None, status_callback=None,
               status_callback_method=None, **kwargs):
        """
        Create a <Number> element

        :param phone_number: Phone Number to dial
        :param send_digits: DTMF tones to play when the call is answered
        :param url: TwiML URL
        :param method: TwiML URL method
        :param status_callback_event: Events to call status callback
        :param status_callback: Status callback URL
        :param status_callback_method: Status callback URL method
        :param kwargs: additional attributes

        :returns: <Number> element
        """
        return self.nest(Number(
            phone_number,
            send_digits=send_digits,
            url=url,
            method=method,
            status_callback_event=status_callback_event,
            status_callback=status_callback,
            status_callback_method=status_callback_method,
            **kwargs
        ))

    def queue(self, name, url=None, method=None, reservation_sid=None,
              post_work_activity_sid=None, **kwargs):
        """
        Create a <Queue> element

        :param name: Queue name
        :param url: Action URL
        :param method: Action URL method
        :param reservation_sid: TaskRouter Reservation SID
        :param post_work_activity_sid: TaskRouter Activity SID
        :param kwargs: additional attributes

        :returns: <Queue> element
        """
        return self.nest(Queue(
            name,
            url=url,
            method=method,
            reservation_sid=reservation_sid,
            post_work_activity_sid=post_work_activity_sid,
            **kwargs
        ))

    def sim(self, sim_sid, **kwargs):
        """
        Create a <Sim> element

        :param sim_sid: SIM SID
        :param kwargs: additional attributes

        :returns: <Sim> element
        """
        return self.nest(Sim(sim_sid, **kwargs))

    def sip(self, sip_url, username=None, password=None, url=None, method=None,
            status_callback_event=None, status_callback=None,
            status_callback_method=None, **kwargs):
        """
        Create a <Sip> element

        :param sip_url: SIP URL
        :param username: SIP Username
        :param password: SIP Password
        :param url: Action URL
        :param method: Action URL method
        :param status_callback_event: Status callback events
        :param status_callback: Status callback URL
        :param status_callback_method: Status callback URL method
        :param kwargs: additional attributes

        :returns: <Sip> element
        """
        return self.nest(Sip(
            sip_url,
            username=username,
            password=password,
            url=url,
            method=method,
            status_callback_event=status_callback_event,
            status_callback=status_callback,
            status_callback_method=status_callback_method,
            **kwargs
        ))


class Sip(TwiML):
    """ <Sip> TwiML Noun """

    def __init__(self, sip_url, **kwargs):
        super(Sip, self).__init__(**kwargs)
        self.name = 'Sip'
        self.value = sip_url


class Sim(TwiML):
    """ <Sim> TwiML Noun """

    def __init__(self, sim_sid, **kwargs):
        super(Sim, self).__init__(**kwargs)
        self.name = 'Sim'
        self.value = sim_sid


class Number(TwiML):
    """ <Number> TwiML Noun """

    def __init__(self, phone_number, **kwargs):
        super(Number, self).__init__(**kwargs)
        self.name = 'Number'
        self.value = phone_number


class Conference(TwiML):
    """ <Conference> TwiML Noun """

    def __init__(self, name, **kwargs):
        super(Conference, self).__init__(**kwargs)
        self.name = 'Conference'
        self.value = name


class Client(TwiML):
    """ <Client> TwiML Noun """

    def __init__(self, name, **kwargs):
        super(Client, self).__init__(**kwargs)
        self.name = 'Client'
        self.value = name
