Skip to main content

nominal_api/conjure/objects/ingest/api/
docker_image_source.rs

1/// Docker container image source definition.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct DockerImageSource {
17    #[builder(into)]
18    #[serde(rename = "registry")]
19    registry: String,
20    #[builder(into)]
21    #[serde(rename = "repository")]
22    repository: String,
23    #[builder(custom(type = super::TagDetails, convert = Box::new))]
24    #[serde(rename = "tagDetails")]
25    tag_details: Box<super::TagDetails>,
26    #[builder(custom(type = super::Authentication, convert = Box::new))]
27    #[serde(rename = "authentication")]
28    authentication: Box<super::Authentication>,
29    #[builder(default, into)]
30    #[serde(rename = "command", skip_serializing_if = "Option::is_none", default)]
31    command: Option<String>,
32}
33impl DockerImageSource {
34    /// The container registry where the image is hosted.
35    #[inline]
36    pub fn registry(&self) -> &str {
37        &*self.registry
38    }
39    /// The repository name of the image.
40    #[inline]
41    pub fn repository(&self) -> &str {
42        &*self.repository
43    }
44    #[inline]
45    pub fn tag_details(&self) -> &super::TagDetails {
46        &*self.tag_details
47    }
48    /// Optional authentication for accessing private container registries.
49    #[inline]
50    pub fn authentication(&self) -> &super::Authentication {
51        &*self.authentication
52    }
53    #[inline]
54    pub fn command(&self) -> Option<&str> {
55        self.command.as_ref().map(|o| &**o)
56    }
57}