search/
configuration_overrides_types.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5//! This module defines the structures that we use for serde_json to parse
6//! the search configuration overrides.
7
8use crate::JSONEngineUrls;
9use serde::Deserialize;
10
11/// Represents search configuration overrides record.
12#[derive(Debug, Deserialize, Clone)]
13#[serde(rename_all = "camelCase")]
14pub struct JSONOverridesRecord {
15    /// This is the identifier of the search engine in search-config-v2 that this
16    /// record will override. It may be extended by telemetry_suffix.
17    pub identifier: String,
18
19    /// The partner code for the engine or variant. This will be inserted into
20    /// parameters which include '{partnerCode}
21    pub partner_code: String,
22
23    /// Suffix that is appended to the search engine identifier following a
24    /// dash, i.e. `<identifier>-<suffix>`. There should always be a suffix
25    /// supplied if the partner code is different.
26    pub telemetry_suffix: Option<String>,
27
28    /// The url used for reporting clicks.
29    pub click_url: String,
30
31    /// The URLs associated with the search engine.
32    //pub urls: JSONOverrideEngineUrls,
33    pub urls: JSONEngineUrls,
34}
35
36/// Represents the search configuration overrides as received from remote settings.
37#[derive(Debug, Deserialize)]
38pub(crate) struct JSONSearchConfigurationOverrides {
39    pub data: Vec<JSONOverridesRecord>,
40}