Get Campaign settings

@retun Models\Settings

@link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-settings-docpage/
545937
public function getSettings()
    {
        $resource = 'campaigns/' . $this->campaignId . '/settings.json';
       
        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));

        $decodedResponseBody = $this->getDecodedBody($response->getBody());
       
        $getSettingsResponse = new Models\GetSettingsResponse($decodedResponseBody);
        return $getSettingsResponse->getSettings();
    }
1073400
public function parseSourceCampaignSettings()
    {
        if (isset($this->campaignSettingsParsed[$this->campaignId])) {
            // Campaign settings have already been parsed for this campaign/session, likely due to a batch import.
            return;
        }

        // Check that the campaign is in the whitelist for this source.
        $campaignSettings = $this->campaignSettingsModel->setContactSource($this->contactSource)
            ->getCampaignSettingsById($this->campaignId);

        // @todo - Support or thwart multiple copies of the same campaign, should it occur. In the meantime...
        $campaignSettings = reset($campaignSettings);
        if (
            !$campaignSettings
            && !$this->imported
            && !$this->contactSource->getInternal()
        ) {
            throw new ContactSourceException(
                'The campaignId supplied is not currently in the permitted list of campaigns for this source.',
                Codes::HTTP_GONE,
                null,
                Stat::TYPE_INVALID,
                'campaignId'
            );
        }
        // Establish parameters from campaign settings; skip some settings on contact import from file.
        if (!$this->imported) {
            // Establish defaults (especially for allCampaigns).
            $this->realTime  = isset($campaignSettings->realTime) ? boolval($campaignSettings->realTime) : true;
            $this->limits    = isset($campaignSettings->limits) ? $campaignSettings->limits : [];
            $this->scrubRate = isset($campaignSettings->scrubRate) ? intval($campaignSettings->scrubRate) : 0;
        }
        $this->cost      = isset($campaignSettings->cost) ? (abs(floatval($campaignSettings->cost))) : 0;
        $this->utmSource = !empty($this->contactSource->getUtmSource()) ? $this->contactSource->getUtmSource() : '';

        // Apply field overrides.
        if ($this->utmSource) {
            $this->fieldsProvided['utm_source'] = $this->utmSource;
        }
        $this->addTrace('contactSourceRealTime', $this->realTime);
        $this->addTrace('contactSourceCost', $this->cost);
        $this->addTrace('contactSourceUtmSource', $this->utmSource);

        $this->campaignSettingsParsed[$this->campaignId] = true;
    }
1063120
protected static function p2mSettings()
	{
		if(isset(self::$_p2mSettings)) {
			return self::$_p2mSettings;
		}

		return self::getSettingsItem(self::$_p2mSettings, Yii::$app->params, 'p2m');
	}
171763
public function settings()
    {
        $form = array(
            'name' => 'SettingsForm',
            'caption' => $this->title . ' ' . $this->version,
            'width' => '500px',
            'fields' => array (
                array('type' => 'hidden', 'name' => 'update', 'value' => $this->name),
                array('type' => 'checkbox', 'name' => 'notes', 'label' => 'Включить заметки'),
            ),
            'buttons' => array('ok', 'apply', 'cancel'),
        );

        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $html = $page->renderForm($form, $this->settings);
        return $html;
    }
1056900
public com.google.api.ads.adwords.axis.v201809.cm.Setting[] getSettings() {
        return settings;
    }
1235723
public function getTextSettings()
    {
        $options = $this->util->getTranslated()->getEmptyDropdownArray() +
                $this->util->getDbLookup()->getOrganizations();

        foreach (['gaf_filter_text1', 'gaf_filter_text2', 'gaf_filter_text3', 'gaf_filter_text4'] as $i => $field) {
            $output[$field] = [
                'label'        => $this->_('Organization') . ' ' . ($i + 1),
                'multiOptions' => $options,
                'required'     => false,
                ];
        }


        return $output;
    }
847070
public function actionSettings()
    {
        $model = new ConfigForm();
        $data = Yii::$app->request->post('ConfigForm');
        if ($data) {
            if (User::can(Rbac::PERM_CHANGE_SETTINGS)) {
                if ($model->update($data)) {
                    Log::info('Settings updated', null, __METHOD__);
                    $this->success(Yii::t('podium/flash', 'Settings have been updated.'));
                    return $this->refresh();
                }
                $this->error(Yii::t('podium/flash', "One of the setting's values is too long (255 characters max)."));
            } else {
                $this->error(Yii::t('podium/flash', 'You are not allowed to perform this action.'));
            }
        }
        return $this->render('settings', ['model' => $model]);
    }
1152828
public function settings()
    {
        if (is_null($this->settings)) {
            $this->settings['version_php'] = $this->getPhpVersion();
            $this->settings['version_laravel'] = app()->version();
            $this->settings['cache_config'] = app()->configurationIsCached();
            $this->settings['cache_route'] = app()->routesAreCached();
            $this->settings['timezone'] = config('app.timezone');
            $this->settings['debug'] = config('app.debug');
            $this->settings['eyewitness_debug'] = config('eyewitness.debug');
            $this->settings['env'] = config('app.env');
            $this->settings['name'] = config('app.name', 'Laravel App');
            $this->settings['maintenance_mode'] = app()->isDownForMaintenance();
        }

        return $this->settings;
    }
197362
public function getApplyFormSettings()
    {
        if (!$this->applyFormSettings) {
            $settings = new DisableElementsCapableFormSettings();
            $settings->setForm('Applications/Apply');
            $this->applyFormSettings = $settings;
        }
        return $this->applyFormSettings;
    }
254945
public function actionIndex()
    {
        $this->requirePostRequest();
        $request = Craft::$app->getRequest();

        // Set params
        $params = [
          'name' => $request->post('name'),
          'contact' => $request->post('contact'),
          'permission_reminder' => $request->post('permission_reminder'),
          'campaign_defaults' => $request->post('campaign_defaults'),
          'email_type_option' => $request->post('email_type_option') ? true : false
        ];

        // Post request to create list
        $response = HttpService::request('POST', 'lists', $params);

        if ($response['success'] and $response['statusCode'] === 200) {
          Craft::$app->getSession()->setNotice('List created.');
          return $this->redirectToPostedUrl();
        } elseif ($response['success'] and $response['statusCode'] !== 200) {
          Craft::$app->session->setFlash('errorBody', $response['body']);
          Craft::$app->getSession()->setError($response['statusCode'].' '.$response['reason']);
        } else {
          Craft::$app->getSession()->setError($response['reason']);
        }

        return $this->redirect('mailchimp-lists/create');
    }
863842
public function settings()
    {
        $pages = $this->page->get();
        $site = $this->site->first(); //change method to get active site
        
        return view('chuckcms::backend.settings.index', compact('pages', 'site'));
    }
669535
protected function _getViewModeSettings()
    {
        $viewMode = $this->viewMode();
        $settings = [];
        if (!empty($this->metadata->view_modes[$viewMode])) {
            $settings = $this->metadata->view_modes[$viewMode];
        }

        return $settings;
    }
228190
private function getBranches($campaignId = NULL) {
    $locations = [
      'default' => $this->t('Location'),
    ];

    $query = $this->entityTypeManager->getStorage('node')->getQuery();
    $nids = $query->condition('type', 'branch')
      ->condition('status', '1')
      ->sort('title', 'ASC')
      ->execute();
    $branches = $this->entityTypeManager->getStorage('node')->loadMultiple($nids);

    // Get list of branches related to the Campaign.
    $campaign = NULL;
    $campaignBranches = [];
    if (!empty($campaignId)) {
      /** @var \Drupal\node\Entity\Node $campaign Campaign node. */
      $campaign = $this->entityTypeManager->getStorage('node')->load($campaignId);
      $branchesField = $campaign->get('field_campaign_branch_target')->getValue();
      foreach ($branchesField as $branchItem) {
        $campaignBranches[] = $branchItem['target_id'];
      }
    }
    /** @var \Drupal\node\Entity\Node $branch */
    foreach ($branches as $branch) {
      if (!empty($campaignBranches) && !in_array($branch->id(), $campaignBranches)) {
        continue;
      }
      $locations[$branch->id()] = $branch->getTitle();
    }

    return $locations;
  }
587817
public function get_setting() {
        $result1 = $this->config_read($this->name);
        $result2 = $this->config_read($this->name2);
        if (is_null($result1) or is_null($result2)) {
            return NULL;
        }

        return array('h' => $result1, 'm' => $result2);
    }
24648
def get_settings(*args)
      SafeIndex.log_or_throw(:get_settings, @raise_on_failure) do
        begin
          @index.get_settings(*args)
        rescue Algolia::AlgoliaError => e
          return {} if e.code == 404 # not fatal
          raise e
        end
      end
    end
786855
public com.google.api.ads.admanager.axis.v201902.CompanySettings getSettings() {
        return settings;
    }
985711
public static function getDefaultSettings()
    {
        $settings = parent::getDefaultSettings();

        $settings['templates.path'] = '';
        $settings['bono.base.path'] = '..';
        $settings['bono.theme'] = 'Bono\\Theme\\DefaultTheme';
        $settings['config.path'] = '../config';
        // slim settings debug MUST BE set true to propagate exception/error to middleware
        // commonhandlermiddleware will handle this later
        $settings['debug'] = true;
        $settings['autorun'] = true;
        $settings['bono.cli'] = (PHP_SAPI === 'cli');

        if (!isset($settings['bono.debug'])) {
            $settings['bono.debug'] = ($settings['mode'] == 'development') ? true : false;
        }

        $settings['view'] = 'Bono\\View\\LayoutedView';
        $settings['bono.partial.view'] = 'Slim\\View';

        return $settings;
    }