Retrieve survey settings

{@link https://api.nfieldmr.com/help/api/get-v1-surveys-surveyid-settings}
9372
function getSurveySettings (defOptions, credentials, token, surveyId, callback) {
  
  if (typeof surveyId === 'function') callback = surveyId;
  if (checkRequiredParameter(surveyId)) return Promise.reject(Error(`Missing required parameter 'SurveyId'`)).nodeify(callback);
  
  var options = {
    method : 'GET',
    uri : `v1/Surveys/${surveyId}/Settings`
  };
  
  return requestWithTokenCheck(defOptions, credentials, token, options, callback);
}
1223761
public function getSurveyAnswerModel(\Gems_Tracker_Survey $survey, $language = null, $sourceSurveyId = null)
    {
        static $cache = array();        // working with 'real' cache produces out of memory error

        if (null === $sourceSurveyId) {
            $sourceSurveyId = $this->_getSid($survey->getSurveyId());
        }
        $language = $this->_getLanguage($sourceSurveyId, $language);
        $cacheId  = $sourceSurveyId . strtr($language, '-.', '__');

        if (!array_key_exists($cacheId, $cache)) {
            $model           = $this->tracker->getSurveyModel($survey, $this);
            $fieldMap        = $this->_getFieldMap($sourceSurveyId, $language)->applyToModel($model);
            $cache[$cacheId] = $model;
        }

        return $cache[$cacheId];
    }
1284428
public function getSettingsFields()
    {
        $fields = parent::getSettingsFields();

        $settings = FieldGroup::create(
            FieldGroup::create(
                NumericField::create('Width', _t('CarouselPage.db_Width')),
                NumericField::create('Height', _t('CarouselPage.db_Height')),
                CheckboxField::create('Captions', _t('CarouselPage.db_Captions'))
            )
        );
        $settings->setName('Carousel');
        $settings->setTitle(_t('CarouselPage.SINGULARNAME'));
        $fields->addFieldToTab('Root.Settings', $settings);

        return $fields;
    }
1266312
function getSettings(account, callback) {
  validate.address(account);

  this.remote.requestAccountInfo({account: account}, function(error, info) {
    if (error) {
      return callback(error);
    }

    var data = info.account_data;
    var settings = {
      account: data.Account,
      transfer_rate: '0'
    };

    // Attach account flags
    _.extend(settings, TxToRestConverter.parseFlagsFromResponse(data.Flags,
      constants.AccountRootFlags));

    // Attach account fields
    _.extend(settings, parseFieldsFromResponse(data,
      constants.AccountRootFields));

    settings.transaction_sequence = String(settings.transaction_sequence);

    callback(null, {settings: settings});
  });
}
476779
def get_response(self):
        
        res = IODWriteRes()
        for field in ["seqNum", "ARUUID", "API", "slotNumber",
                      "subslotNumber", "index"]:
            res.setfieldval(field, self.getfieldval(field))
        return res
653458
@Transactional(readOnly = true)
	public Settings getSettings() {
		try {
			return (Settings) getEntity(StorageConstants.SETTINGS_ROOT);
		} catch (NotFoundException e) {
			// should never happen
			e.printStackTrace();
			LOG.error("Could not read Settings node", e);
			return new Settings();
		}
	}
1280915
public function getNumberOfAnswers($surveyId) {
        $fields['tokenCount'] = 'COUNT(DISTINCT gto_id_token)';
        $select               = $this->loader->getTracker()->getTokenSelect($fields)->andReceptionCodes([]);
        $select->forSurveyId($surveyId)
                ->onlySucces()
                ->onlyCompleted();
        $row                  = $select->fetchRow();
        return sprintf($this->_('Answered surveys: %d.'), $row['tokenCount']);
    }
256746
protected function retrieveSettings()
    {
        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit'])) {
            $this->cachedSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit']);
        } else {
            $this->cachedSettings = [];
        }

        $this->settingsHaveBeenRetrieved = true;
    }
1209530
public function list_settings()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/s/' . $this->site . '/get/setting');

        return $this->process_response($response);
    }
30744
def list_request_settings(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/request_settings" % (service_id, version_number))
		return map(lambda x: FastlyRequestSetting(self, x), content)
839080
public void mergeWithSurveyServerSettings(Settings settings) {
        if(settings == null) {
            return;
        }

        this.adminPanelCustomMessage = settings.adminPanelCustomMessage;
        this.adminPanelTimeDelay = settings.adminPanelTimeDelay;
        this.localizedTexts = settings.localizedTexts;
        this.userID = settings.userID;
        this.accountID = settings.accountID;
        this.resurveyThrottle = settings.resurveyThrottle;
        this.declineResurveyThrottle = settings.declineResurveyThrottle;
        this.surveyType = settings.surveyType;
    }
670230
private FacebookSettings fetchSettings() {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
        if (!preferences.getBoolean(mContext.getString(R.string.wings_facebook__link_key), false)) {
            return null;
        }

        int destinationId = preferences.getInt(mContext.getString(R.string.wings_facebook__destination_id_key), DestinationId.UNLINKED);
        String accountName = preferences.getString(mContext.getString(R.string.wings_facebook__account_name_key), null);
        String albumName = preferences.getString(mContext.getString(R.string.wings_facebook__album_name_key), null);
        String albumGraphPath = preferences.getString(mContext.getString(R.string.wings_facebook__album_graph_path_key), null);
        String pageAccessToken = preferences.getString(mContext.getString(R.string.wings_facebook__page_access_token_key), null);
        String photoPrivacy = preferences.getString(mContext.getString(R.string.wings_facebook__photo_privacy_key), null);

        return FacebookSettings.newInstance(destinationId, accountName, albumName, albumGraphPath, pageAccessToken, photoPrivacy);
    }
849287
public static function get_questions($surveyid) {
        global $DB, $USER;

        $params = self::validate_parameters(self::get_questions_parameters(),
                                            array(
                                                'surveyid' => $surveyid
                                            ));
        $warnings = array();

        // Request and permission validation.
        $survey = $DB->get_record('survey', array('id' => $params['surveyid']), '*', MUST_EXIST);
        list($course, $cm) = get_course_and_cm_from_instance($survey, 'survey');

        $context = context_module::instance($cm->id);
        self::validate_context($context);
        require_capability('mod/survey:participate', $context);

        $mainquestions = survey_get_questions($survey);

        foreach ($mainquestions as $question) {
            if ($question->type >= 0) {
                // Parent is used in subquestions.
                $question->parent = 0;
                $questions[] = survey_translate_question($question);

                // Check if the question has subquestions.
                if ($question->multi) {
                    $subquestions = survey_get_subquestions($question);
                    foreach ($subquestions as $sq) {
                        $sq->parent = $question->id;
                        $questions[] = survey_translate_question($sq);
                    }
                }
            }
        }

        $result = array();
        $result['questions'] = $questions;
        $result['warnings'] = $warnings;
        return $result;
    }
244110
public function getDataModelSettings()
    {
        if (! $this->exists) {
            return array();
        }

        $fieldSettings = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $fieldSettings[$key] = $field->getDataModelSettings();
            }
        }

        return $fieldSettings;
    }
1232583
public function getSurvey($surveyId, $includePages = false)
	{
		if ($includePages) {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('surveys/%d/details', $surveyId))
			);
		} else {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('surveys/%d', $surveyId))
			);
		}
	}
1144612
def nps_survey_response_update(self, survey_id, id, data, **kwargs):
        ""
        api_path = "/api/v2/nps/surveys/{survey_id}/responses/{id}.json"
        api_path = api_path.format(survey_id=survey_id, id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
569920
public com.google.api.ads.adwords.axis.v201809.cm.NetworkSetting getNetworkSetting() {
        return networkSetting;
    }