Get Send History related to a specific survey.
 Survey ID must be set inside the api request object.

 @return [Array<QuestionproRails::EmailBatch>] Email Batches.
763895
def get_send_history
      url = ApiRequest.base_path("questionpro.survey.emailBatchStatistics")
      result = self.class.get(url, body: self.options)

      self.full_response = result
      self.status = result['status']

      email_batches = []
      result_email_batches = result['response']['emailBatches']
      result_email_batches.each do |email_batch|
        email_batches.push(EmailBatch.new(email_batch))
      end
      
      return email_batches      
    end
139228
def extract
      @survey.questions.collect do |question|
        results =
          case question
          when Rapidfire::Questions::Select, Rapidfire::Questions::Radio,
            Rapidfire::Questions::Checkbox
            answers = question.answers.map(&:answer_text).map do |text|
              text.to_s.split(Rapidfire.answers_delimiter)
            end.flatten

            answers.inject(Hash.new(0)) { |total, e| total[e] += 1; total }
          when Rapidfire::Questions::Short, Rapidfire::Questions::Date,
            Rapidfire::Questions::Long, Rapidfire::Questions::Numeric
            question.answers.pluck(:answer_text)
          end

        QuestionResult.new(question: question, results: results)
      end
    end
1219506
def list_surveys():  # noqa: E501
    
    pm = PrecisionMapper(login=_LOGIN, password=_PASSWORD)
    pm.sign_in()
    surveys = pm.get_surveys()
    shared_surveys = pm.get_shared_surveys()

    survey_list = []
    for survey in surveys+shared_surveys:
        survey_obj = Survey(
            date=survey.date, image_nb=survey.image_nb,
            location=survey.location, name=survey.name,
            sensors=survey.sensor, size=survey.size, survey_id=survey.id)
        survey_list.append(survey_obj)
    return survey_list
1164738
def list_surveys(session):
    """"""
    params = {'sUser': session['user'], 'sSessionKey': session['token']}
    data = set_params('list_surveys', params)
    req = requests.post(session['url'], data=data, headers=headers)
    return req.text
18256
public function getPresetTargetData()
    {
        $targetData = parent::getPresetTargetData();
        if ($this->token) {
            $targetData['track']        = $this->token->getTrackName();
            $targetData['round']        = $this->token->getRoundDescription();
            $targetData['survey']       = $this->token->getSurvey()->getName();
            $targetData['last_contact'] = $this->token->getMailSentDate();
        }
        return $targetData;
    }
1358438
@Override
	public List<CommandHistoryItem> getCommandHistory(
			int pageNumber,
			String applicationName,
			int itemsPerPage,
			String sortingCriteria,
			String sortingOrder ) {

		if( pageNumber < 1 )
			pageNumber = 1;

		this.logger.fine( "Request: get the history of commands execution (page = " + pageNumber + ")." );
		return this.manager.commandsMngr().getHistory(
				(pageNumber -1) * itemsPerPage,
				itemsPerPage,
				sortingCriteria,
				sortingOrder,
				applicationName );
	}
1229474
def inbox(bid_id, *params, &block)
      options = {:query => {}}
      options[:query] = params[0] if params.length > 0    
      response = self.class.get "/workroom/#{bid_id}/inbox", options
      yield(response) if block_given?
      response
    end
784013
public function getSurvey()
    {
        if (false !== $this->_survey) {
            return $this->_survey;
        }
        $surveyId = $this->getSurveyId();

        if ($surveyId) {
            $this->_survey = $this->tracker->getSurvey($surveyId);
        } else {
            $this->_survey = null;
        }

        return $this->_survey;
    }
1238642
@GET
    @Path("history")
    public List<APIConnectionRecord> getConnectionHistory()
            throws GuacamoleException {

        // Retrieve the requested connection's history
        List<APIConnectionRecord> apiRecords = new ArrayList<APIConnectionRecord>();
        for (ConnectionRecord record : connection.getHistory())
            apiRecords.add(new APIConnectionRecord(record));

        // Return the converted history
        return apiRecords;

    }

    /**
     * Returns a resource which provides read-only access to the subset of
     * SharingProfiles that the current user can use to share this connection.
     *
     * @return
     *     A resource which provides read-only access to the subset of
     *     SharingProfiles that the current user can use to share this
     *     connection.
     *
     * @throws GuacamoleException
     *     If the SharingProfiles associated with this connection cannot be
     *     retrieved.
     */
    @Path("sharingProfiles")
    public DirectoryResource<SharingProfile, APISharingProfile>
            getSharingProfileDirectoryResource() throws GuacamoleException {

        // Produce subset of all SharingProfiles, containing only those which
        // are associated with this connection
        Directory<SharingProfile> sharingProfiles = new DirectoryView<SharingProfile>(
            userContext.getSharingProfileDirectory(),
            connection.getSharingProfileIdentifiers()
        );

        // Return a new resource which provides access to only those SharingProfiles
        return sharingProfileDirectoryResourceFactory.create(userContext, sharingProfiles);

    }

}
1206405
def send_batch
      batch = @batch.map(&:first) # get the requests
      response = send_batch_request(batch)

      begin
        responses = JSON.parse(response)
      rescue
        raise Jimson::ClientError::InvalidJSON.new(json)
      end

      process_batch_response(responses)
      responses = @batch

      @batch = []

      responses
    end
630908
public function getSurveyResponse($surveyId, $responseId, $detailed = false, array $filters = [])
	{
		if ($detailed) {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('surveys/%s/responses/%s/details', $surveyId, $responseId), [ 
					'query' => $filters 
				])
			);
		} else {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('surveys/%s/responses/%s', $surveyId, $responseId), [ 
					'query' => $filters 
				])
			);
		}
	}
1098487
def campaigns
      response = @@soap.getClientCampaigns(:apiKey => @apiKey, :clientID => @clientID )
      campaign_list = handle_response response.client_GetCampaignsResult
      campaign_list.collect do |campaign|  
        Campaign.new(campaign.campaignID, campaign.subject, campaign.name, campaign.sentDate, campaign.totalRecipients, :apiKey=> @apiKey)
      end
    end
57611
public static Response getBatchReadResponse(App app, List<String> ids) {
		try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
				RestUtils.class, "batch", "read")) {
			if (app != null && ids != null && !ids.isEmpty()) {
				ArrayList<ParaObject> results = new ArrayList<>(ids.size());
				for (ParaObject result : Para.getDAO().readAll(app.getAppIdentifier(), ids, true).values()) {
					if (checkImplicitAppPermissions(app, result) && checkIfUserCanModifyObject(app, result)) {
						results.add(result);
					}
				}
				return Response.ok(results).build();
			} else {
				return getStatusResponse(Response.Status.BAD_REQUEST, "Missing ids.");
			}
		}
	}
1273303
@GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getBatches(@Context HttpServletRequest req) {
        PrincipalUser owner = validateAndGetOwner(req, null);
        SystemAssert.requireArgument(owner != null, "Owner cannot be null");

        Map<String,String> batches = batchService.findBatchesByOwnerName(owner.getUserName());
        return Response.ok(batches, MediaType.APPLICATION_JSON).build();
    }
214357
public LsQuestion getQuestion(int surveyId, int questionId) throws LimesurveyRCException {
        return getQuestions(surveyId).filter(question -> question.getId() == questionId)
                .findFirst().orElseThrow(() -> new LimesurveyRCException("No question found for id " + questionId + " in survey " + surveyId));
    }
560493
public function &GetFieldPkgShopWishlistMailHistoryList()
    {
        $oWishlistHistoryItems = $this->GetFromInternalCache('oPkgShopWishlistMailHistoryList');
        if (is_null($oWishlistHistoryItems)) {
            $oWishlistHistoryItems = TdbPkgShopWishlistMailHistoryList::GetListForPkgShopWishlistId($this->id, $this->iLanguageId);
            $oWishlistHistoryItems->bAllowItemCache = true;
            $this->SetInternalCache('oPkgShopWishlistMailHistoryList', $oWishlistHistoryItems);
        }

        return $oWishlistHistoryItems;
    }
821976
def questions(self):
        
        from .question import Question
        question_url = Topic_Questions_Url.format(self.id)
        params = {'page': 1}
        older_time_stamp = int(time.time()) * 1000
        while True:
            res = self._session.get(question_url, params=params)
            soup = BeautifulSoup(res.content)
            if soup.find('div', class_='error') is not None:
                return
            questions = soup.find_all('div', class_='question-item')
            questions = list(filter(
                lambda x: int(x.h2.span['data-timestamp']) < older_time_stamp,
                questions))
            for qu_div in questions:
                url = Zhihu_URL + qu_div.h2.a['href']
                title = qu_div.h2.a.text.strip()
                creation_time = datetime.fromtimestamp(
                        int(qu_div.h2.span['data-timestamp']) // 1000)
                yield Question(url, title, creation_time=creation_time,
                               session=self._session)
            older_time_stamp = int(questions[-1].h2.span['data-timestamp'])
            params['page'] += 1