Exemplo n.º 1
0
class Teams:
    """Api client for conversations"""

    teams = bind_request(
        api_path='/teams/teams',
        model=models.Team,
        query_parameters=query_params.ListTeams,
        description='Api client for teams'
    )
    members = bind_request(
        api_path='/teams/members',
        model=models.Member,
        query_parameters=query_params.ListTeamMembers,
        description='Api client for team members'
    )
Exemplo n.º 2
0
class RateLimit:
    """Api client for rete limit testing"""

    rate_limit_error_test = bind_request(
        api_path='/rate-limit/error-test',
        model=RateLimitError,
        query_parameters=query_params.RateLimitParams,
        method=constants.RequestConst.GET,
        # ignore_error=True,
        description='Rate limit error test')

    rate_limit_request_test = bind_request(
        api_path='/rate-limit/request-test',
        model=RateLimitError,
        query_parameters=query_params.RateLimitParams,
        method=constants.RequestConst.GET,
        # ignore_error=True,
        description='Rate limit request test')
Exemplo n.º 3
0
class Automation:
    """Api client for automation"""

    chatbot_activity = bind_request(
        api_path='/automation/chatbot/activity',
        model=ServerMessage,
        query_parameters=query_params.ChatbotActivity,
        method=constants.RequestConst.PUT,
        description='Api client for turning the '
        'chatbot on or off for a conversation')

    chatbot_activity_status = bind_request(
        api_path='/automation/chatbot/activity/status',
        model=ChatbotActivityStatus,
        force_single_model_response=True,
        query_parameters=query_params.ChatbotActivityStatus,
        method=constants.RequestConst.GET,
        description='Api client for getting current '
        'chatbot status for a conversation')
Exemplo n.º 4
0
class Messages:
    """Api client for conversations"""

    message_templates = bind_request(
        api_path='/conversations/messages/templates',
        model=models.MessageTemplate,
        query_parameters=query_params.ListMessageTemplates,
        description='Api client for message templates')
    send_template_message = bind_request(
        api_path='/conversations/messages/templates/send',
        model=models.SentMessage,
        method=constants.RequestConst.POST,
        query_parameters=query_params.SendTemplateMessage,
        description='Api client for sending template conversations')
    send_message = bind_request(
        api_path='/conversations/messages/send',
        model=models.SentMessage,
        method=constants.RequestConst.POST,
        query_parameters=query_params.SendMessage,
        description='Api client for sending template conversations')
    conversations = bind_request(
        api_path='/conversations',
        model=models.Conversation,
        query_parameters=query_params.ListConversations,
        description='Api client for fetching conversations')
    messages = bind_request(
        api_path='/conversations/messages',
        model=models.Message,
        query_parameters=query_params.ListMessages,
        description='Api client for fetching conversation messages')

    get_conversation = bind_request(
        api_path='/conversation',
        query_parameters=query_params.GetSingleConversation,
        model=models.Conversation,
        force_single_model_response=True,
        description='Api client for fetching single conversation data')
    update_conversation = bind_request(
        api_path='/conversation',
        method=constants.RequestConst.POST,
        query_parameters=query_params.UpdateSingleConversation,
        model=models.Conversation,
        force_single_model_response=True,
        # query_parameters=query_params.ListMessages,
        description='Api client for updating a conversation')
Exemplo n.º 5
0
class Contacts:
    """Api client for contacts"""

    contacts = bind_request(api_path='/contacts',
                            model=models.Contact,
                            query_parameters=query_params.ListContacts,
                            description='Api client for contacts')
    subscribe_contact = bind_request(
        api_path='/contacts/subscribe',
        model=models.Contact,
        method=constants.RequestConst.POST,
        query_parameters=query_params.UpdateContacts,
        default_parameters={
            constants.RequestConst.BLOCK_AUTOMATION: True,
            constants.RequestConst.BLOCK_NOTIFICATIONS: True,
        },
        description='Api client for subscribing a contacts')
    update_contact = bind_request(
        api_path='/contacts',
        model=models.Contact,
        method=constants.RequestConst.PUT,
        query_parameters=query_params.UpdateContacts,
        description='Api client for updating contacts')
    tags = bind_request(api_path='/contacts/tags',
                        model=models.ContactTag,
                        query_parameters=query_params.ListTags,
                        description='Api client for tags')
    update_tag = bind_request(api_path='/contacts/tags',
                              model=models.ContactTag,
                              method=constants.RequestConst.PUT,
                              query_parameters=query_params.UpdateTag,
                              description='Api client for updating tags')
    create_tag = bind_request(api_path='/contacts/tags',
                              model=models.ContactTag,
                              method=constants.RequestConst.POST,
                              query_parameters=query_params.ListTags,
                              description='Api client for updating tags')
    delete_tag = bind_request(api_path='/contacts/tags',
                              model=ServerMessage,
                              method=constants.RequestConst.DELETE,
                              query_parameters=query_params.DeleteTag,
                              description='Api client for deleting tags')
    contact_fields = bind_request(
        api_path='/contacts/fields',
        model=models.ContactField,
        query_parameters=query_params.ListContactFields,
        description='Api client for contact fields')
    create_contact_field = bind_request(
        api_path='/contacts/fields',
        model=models.ContactField,
        method=constants.RequestConst.POST,
        query_parameters=query_params.CreateContactFields,
        description='Api client for creating contact contact fields')
    update_contact_field = bind_request(
        api_path='/contacts/fields',
        model=models.ContactField,
        method=constants.RequestConst.PUT,
        query_parameters=query_params.UpdateContactFields,
        description='Api client for updating contact contact fields')
    delete_contact_field = bind_request(
        api_path='/contacts/fields',
        model=ServerMessage,
        method=constants.RequestConst.DELETE,
        query_parameters=query_params.DeleteContactFields,
        description='Api client for deleting contact contact fields')