def post(self, data, action):
        body = ''

        if action == SalesforceSoapAPI.Action.QUERY:
            body = query_body = utils.get_soap_query_body(data)

        elif action == SalesforceSoapAPI.Action.QUERYMORE:
            body = utils.get_soap_query_more_body(data)

        elif action == SalesforceSoapAPI.Action.QUERYALL:
            body = utils.get_soap_query_body(data)

        elif action == SalesforceSoapAPI.Action.SEARCH:
            body = utils.get_soap_search_body(data)

        else:
            raise ValueError("'action' " + action + " is not supported!")

        request_body = utils.soap_request_header().format(
            access_token=self.auth.access_token, method=action, request=body)

        post_url = self.url_resources.get_full_resource_url(
            self.auth.instance_url)

        return self.__send_request('POST', post_url, action, data=request_body)
    def post(self, data, action):
        body = ''

        if action == SalesforceSoapAPI.Action.QUERY:
            body = utils.get_soap_query_body(data)

        elif action == SalesforceSoapAPI.Action.QUERYMORE:
            body = utils.get_soap_query_more_body(data)

        elif action == SalesforceSoapAPI.Action.QUERYALL:
            body = utils.get_soap_query_body(data)

        elif action == SalesforceSoapAPI.Action.SEARCH:
            body = utils.get_soap_search_body(data)

        else:
            raise ValueError("'action' " + action + " is not supported!")

        request_body = utils.soap_request_header().format(
            access_token=self.auth.access_token,
            method=action,
            request=body)

        post_url = self.url_resources.get_full_resource_url(
            self.auth.instance_url)

        return self.__send_request('POST',
                                   post_url,
                                   action,
                                   data=request_body)
    def post(self, data, action=None):
        if action is None:
            raise ValueError("'action' is required")

        if action != SoapSObject.Action.DESCRIBE and not isinstance(
                data, list):
            raise TypeError("'create' require a parameter type 'list'")

        body = ''
        if action == SoapSObject.Action.DESCRIBE:
            body = utils.get_soap_describe_body(self.__name)

        elif action == SoapSObject.Action.CREATE:
            body = utils.get_soap_create_body(self.__name, data)

        elif action == SoapSObject.Action.UPDATE:
            body = utils.get_soap_update_body(self.__name, data)

        elif action == SoapSObject.Action.DELETE:
            body = utils.get_soap_delete_body(data)

        else:
            raise ValueError("'action' " + action + " is not supported!")

        request_body = utils.soap_request_header().format(
            access_token=self.auth.access_token, method=action, request=body)

        post_url = self.url_resources.get_full_resource_url(
            self.auth.instance_url)

        return self.__send_request('POST', post_url, action, data=request_body)
    def post(self, data, action=None):
        if action is None:
            raise ValueError("'action' is required")

        if action != SoapSObject.Action.DESCRIBE and not isinstance(data, list):
            raise TypeError("'create' require a parameter type 'list'")

        body = ''
        if action == SoapSObject.Action.DESCRIBE:
            body = utils.get_soap_describe_body(self.__name)

        elif action == SoapSObject.Action.CREATE:
            body = utils.get_soap_create_body(self.__name, data)

        elif action == SoapSObject.Action.UPDATE:
            body = utils.get_soap_update_body(self.__name, data)

        elif action == SoapSObject.Action.DELETE:
            body = utils.get_soap_delete_body(data)

        else:
            raise ValueError("'action' " + action + " is not supported!")

        request_body = utils.soap_request_header().format(
            access_token=self.auth.access_token,
            method=action,
            request=body)

        post_url = self.url_resources.get_full_resource_url(
            self.auth.instance_url)

        return self.__send_request('POST',
                                   post_url,
                                   action,
                                   data=request_body)