#[non_exhaustive]pub struct CIAppGitInfo {Show 13 fields
pub author_email: String,
pub author_name: Option<Option<String>>,
pub author_time: Option<Option<String>>,
pub branch: Option<Option<String>>,
pub commit_time: Option<Option<String>>,
pub committer_email: Option<Option<String>>,
pub committer_name: Option<Option<String>>,
pub default_branch: Option<Option<String>>,
pub message: Option<Option<String>>,
pub repository_url: String,
pub sha: String,
pub tag: Option<Option<String>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
If pipelines are triggered due to actions to a Git repository, then all payloads must contain this.
Note that either tag
or branch
has to be provided, but not both.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.The commit author email.
The commit author name.
The commit author timestamp in RFC3339 format.
branch: Option<Option<String>>
The branch name (if a tag use the tag parameter).
commit_time: Option<Option<String>>
The commit timestamp in RFC3339 format.
committer_email: Option<Option<String>>
The committer email.
committer_name: Option<Option<String>>
The committer name.
default_branch: Option<Option<String>>
The Git repository’s default branch.
message: Option<Option<String>>
The commit message.
repository_url: String
The URL of the repository.
sha: String
The git commit SHA.
tag: Option<Option<String>>
The tag name (if a branch use the branch parameter).
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CIAppGitInfo
impl CIAppGitInfo
Sourcepub fn new(
author_email: String,
repository_url: String,
sha: String,
) -> CIAppGitInfo
pub fn new( author_email: String, repository_url: String, sha: String, ) -> CIAppGitInfo
Examples found in repository?
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent_2341150096.rs (lines 36-40)
17async fn main() {
18 let body = CIAppCreatePipelineEventRequest::new().data(
19 CIAppCreatePipelineEventRequestData::new()
20 .attributes(CIAppCreatePipelineEventRequestAttributes::new(
21 CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
22 Box::new(
23 CIAppPipelineEventPipeline::CIAppPipelineEventInProgressPipeline(Box::new(
24 CIAppPipelineEventInProgressPipeline::new(
25 CIAppPipelineEventPipelineLevel::PIPELINE,
26 "Deploy to AWS".to_string(),
27 false,
28 DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
29 .expect("Failed to parse datetime")
30 .with_timezone(&Utc),
31 CIAppPipelineEventPipelineInProgressStatus::RUNNING,
32 "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
33 "https://my-ci-provider.example/pipelines/my-pipeline/run/1"
34 .to_string(),
35 )
36 .git(Some(CIAppGitInfo::new(
37 "john.doe@email.com".to_string(),
38 "https://github.com/DataDog/datadog-agent".to_string(),
39 "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
40 ))),
41 )),
42 ),
43 ),
44 ))
45 .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
46 );
47 let configuration = datadog::Configuration::new();
48 let api = CIVisibilityPipelinesAPI::with_config(configuration);
49 let resp = api.create_ci_app_pipeline_event(body).await;
50 if let Ok(value) = resp {
51 println!("{:#?}", value);
52 } else {
53 println!("{:#?}", resp.unwrap_err());
54 }
55}
More examples
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent.rs (lines 39-43)
17async fn main() {
18 let body = CIAppCreatePipelineEventRequest::new().data(
19 CIAppCreatePipelineEventRequestData::new()
20 .attributes(CIAppCreatePipelineEventRequestAttributes::new(
21 CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
22 Box::new(
23 CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(Box::new(
24 CIAppPipelineEventFinishedPipeline::new(
25 DateTime::parse_from_rfc3339("2021-11-11T11:10:41+00:00")
26 .expect("Failed to parse datetime")
27 .with_timezone(&Utc),
28 CIAppPipelineEventPipelineLevel::PIPELINE,
29 "Deploy to AWS".to_string(),
30 false,
31 DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
32 .expect("Failed to parse datetime")
33 .with_timezone(&Utc),
34 CIAppPipelineEventPipelineStatus::SUCCESS,
35 "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
36 "https://my-ci-provider.example/pipelines/my-pipeline/run/1"
37 .to_string(),
38 )
39 .git(Some(CIAppGitInfo::new(
40 "john.doe@email.com".to_string(),
41 "https://github.com/DataDog/datadog-agent".to_string(),
42 "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
43 ))),
44 )),
45 ),
46 ),
47 ))
48 .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
49 );
50 let configuration = datadog::Configuration::new();
51 let api = CIVisibilityPipelinesAPI::with_config(configuration);
52 let resp = api.create_ci_app_pipeline_event(body).await;
53 if let Ok(value) = resp {
54 println!("{:#?}", value);
55 } else {
56 println!("{:#?}", resp.unwrap_err());
57 }
58}
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent_819339921.rs (lines 44-48)
18async fn main() {
19 let body =
20 CIAppCreatePipelineEventRequest
21 ::new().data(
22 CIAppCreatePipelineEventRequestData::new()
23 .attributes(
24 CIAppCreatePipelineEventRequestAttributes::new(
25 CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
26 Box::new(
27 CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(
28 Box::new(
29 CIAppPipelineEventFinishedPipeline::new(
30 DateTime::parse_from_rfc3339("2021-11-11T11:10:41+00:00")
31 .expect("Failed to parse datetime")
32 .with_timezone(&Utc),
33 CIAppPipelineEventPipelineLevel::PIPELINE,
34 "Deploy to AWS".to_string(),
35 false,
36 DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
37 .expect("Failed to parse datetime")
38 .with_timezone(&Utc),
39 CIAppPipelineEventPipelineStatus::SUCCESS,
40 "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
41 "https://my-ci-provider.example/pipelines/my-pipeline/run/1".to_string(),
42 ).git(
43 Some(
44 CIAppGitInfo::new(
45 "john.doe@email.com".to_string(),
46 "https://github.com/DataDog/datadog-agent".to_string(),
47 "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
48 ),
49 ),
50 ),
51 ),
52 ),
53 ),
54 ),
55 ).provider_name("example-provider".to_string()),
56 )
57 .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
58 );
59 let configuration = datadog::Configuration::new();
60 let api = CIVisibilityPipelinesAPI::with_config(configuration);
61 let resp = api.create_ci_app_pipeline_event(body).await;
62 if let Ok(value) = resp {
63 println!("{:#?}", value);
64 } else {
65 println!("{:#?}", resp.unwrap_err());
66 }
67}
pub fn branch(self, value: Option<String>) -> Self
pub fn commit_time(self, value: Option<String>) -> Self
pub fn committer_email(self, value: Option<String>) -> Self
pub fn committer_name(self, value: Option<String>) -> Self
pub fn default_branch(self, value: Option<String>) -> Self
pub fn message(self, value: Option<String>) -> Self
pub fn tag(self, value: Option<String>) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CIAppGitInfo
impl Clone for CIAppGitInfo
Source§fn clone(&self) -> CIAppGitInfo
fn clone(&self) -> CIAppGitInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CIAppGitInfo
impl Debug for CIAppGitInfo
Source§impl<'de> Deserialize<'de> for CIAppGitInfo
impl<'de> Deserialize<'de> for CIAppGitInfo
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CIAppGitInfo
impl PartialEq for CIAppGitInfo
Source§impl Serialize for CIAppGitInfo
impl Serialize for CIAppGitInfo
impl StructuralPartialEq for CIAppGitInfo
Auto Trait Implementations§
impl Freeze for CIAppGitInfo
impl RefUnwindSafe for CIAppGitInfo
impl Send for CIAppGitInfo
impl Sync for CIAppGitInfo
impl Unpin for CIAppGitInfo
impl UnwindSafe for CIAppGitInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more