예제 #1
0
    def __init__(self, config):
        """
        Initializes the get survey parameters class.
        :param config: the configuration file
        :type config: dct
        """
        params.__init__(self)

        self.surveyId = config["id"]
        self.endpoint = surveyEndpoint(self.dataCenter, self.surveyId)
        self.headers = self.authHeader
예제 #2
0
    def __init__(self, config):
        """
        Initializes the create block parameters class.
        :param config: the configuration file
        :type config: dct
        """
        params.__init__(self)

        self.surveyId = config["id"]
        self.data = config["block"]
        self.endpoint = "{}{}".format(
            surveyDefinitionEndpoint(self.dataCenter, self.surveyId),
            "/blocks")
        self.headers = {"content-type": "application/json"}
        self.headers.update(self.authHeader)
예제 #3
0
 def __init__(self, config):
     """
     Initializes the copy survey parameters
     :param config: the configuration file
     :type config: dct
     """
     params.__init__(self)
     self.surveyId = config["id"]
     self.surveyName = config["name"]
     self.active = config["active"]
     self.endpoint = surveyEndpoint(self.dataCenter, self.surveyId)
     self.data = {"name": self.surveyName,
                  "isActive": self.active}
     self.headers = {"content-type": "application/json"}
     self.headers.update(self.authHeader)
예제 #4
0
    def __init__(self, config):
        """
        Initializes the create question parameters.
        :param config: the configuration file
        :type config: dct
        """
        params.__init__(self)

        self.surveyId = config["id"]
        self.data = config["question"]
        self.endpoint = surveyDefinitionEndpoint(self.dataCenter,
                                                 self.surveyId)
        self.headers = {
            "accept": "application/json",
            "content-type": "application/json"
        }
        self.headers.update(self.authHeader)
예제 #5
0
    def __init__(self, config):
        """
        Initializes the copy survey parameters class.
        :param config: the configuration file
        :type config: dct
        """
        params.__init__(self)

        self.surveyId = config["id"]
        self.surveyName = config["name"]
        self.endpoint = endpoint(self.dataCenter)
        self.data = {"projectName": self.surveyName}
        self.headers = {
            "content-type": "application/json",
            "x-copy-source": self.surveyId,
            "x-copy-destination": self.ownerId,
            "X-copy-destination-owner": self.ownerId
        }
        self.headers.update(self.authHeader)