Skip to main content

nominal_api/conjure/objects/scout/datasource/connection/api/
influx2_connection_details.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct Influx2ConnectionDetails {
16    #[builder(into)]
17    #[serde(rename = "host")]
18    host: String,
19    #[serde(rename = "port")]
20    port: i32,
21    #[builder(default, map(key(type = String, into), value(type = super::HeaderValue)))]
22    #[serde(
23        rename = "headers",
24        skip_serializing_if = "std::collections::BTreeMap::is_empty",
25        default
26    )]
27    headers: std::collections::BTreeMap<String, super::HeaderValue>,
28    #[serde(rename = "org")]
29    org: super::influx::OrgId,
30    #[serde(rename = "tokenSecretRid")]
31    token_secret_rid: super::SecretRid,
32}
33impl Influx2ConnectionDetails {
34    #[inline]
35    pub fn host(&self) -> &str {
36        &*self.host
37    }
38    #[inline]
39    pub fn port(&self) -> i32 {
40        self.port
41    }
42    /// A map of header name to value
43    #[inline]
44    pub fn headers(&self) -> &std::collections::BTreeMap<String, super::HeaderValue> {
45        &self.headers
46    }
47    #[inline]
48    pub fn org(&self) -> &super::influx::OrgId {
49        &self.org
50    }
51    /// Secret Rid of token secret stored in Secrets Service.
52    #[inline]
53    pub fn token_secret_rid(&self) -> &super::SecretRid {
54        &self.token_secret_rid
55    }
56}