CIAppGitInfo

Struct CIAppGitInfo 

Source
#[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.
§author_email: String

The commit author email.

§author_name: Option<Option<String>>

The commit author name.

§author_time: Option<Option<String>>

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

Source

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 43-47)
18async fn main() {
19    let body =
20        CIAppCreatePipelineEventRequest
21        ::new().data(
22            CIAppCreatePipelineEventRequestDataSingleOrArray::CIAppCreatePipelineEventRequestData(
23                Box::new(
24                    CIAppCreatePipelineEventRequestData::new()
25                        .attributes(
26                            CIAppCreatePipelineEventRequestAttributes::new(
27                                CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
28                                    Box::new(
29                                        CIAppPipelineEventPipeline::CIAppPipelineEventInProgressPipeline(
30                                            Box::new(
31                                                CIAppPipelineEventInProgressPipeline::new(
32                                                    CIAppPipelineEventPipelineLevel::PIPELINE,
33                                                    "Deploy to AWS".to_string(),
34                                                    false,
35                                                    DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
36                                                        .expect("Failed to parse datetime")
37                                                        .with_timezone(&Utc),
38                                                    CIAppPipelineEventPipelineInProgressStatus::RUNNING,
39                                                    "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
40                                                    "https://my-ci-provider.example/pipelines/my-pipeline/run/1".to_string(),
41                                                ).git(
42                                                    Some(
43                                                        CIAppGitInfo::new(
44                                                            "john.doe@email.com".to_string(),
45                                                            "https://github.com/DataDog/datadog-agent".to_string(),
46                                                            "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
47                                                        ),
48                                                    ),
49                                                ),
50                                            ),
51                                        ),
52                                    ),
53                                ),
54                            ),
55                        )
56                        .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
57                ),
58            ),
59        );
60    let configuration = datadog::Configuration::new();
61    let api = CIVisibilityPipelinesAPI::with_config(configuration);
62    let resp = api.create_ci_app_pipeline_event(body).await;
63    if let Ok(value) = resp {
64        println!("{:#?}", value);
65    } else {
66        println!("{:#?}", resp.unwrap_err());
67    }
68}
More examples
Hide additional examples
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent.rs (lines 46-50)
18async fn main() {
19    let body =
20        CIAppCreatePipelineEventRequest
21        ::new().data(
22            CIAppCreatePipelineEventRequestDataSingleOrArray::CIAppCreatePipelineEventRequestData(
23                Box::new(
24                    CIAppCreatePipelineEventRequestData::new()
25                        .attributes(
26                            CIAppCreatePipelineEventRequestAttributes::new(
27                                CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
28                                    Box::new(
29                                        CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(
30                                            Box::new(
31                                                CIAppPipelineEventFinishedPipeline::new(
32                                                    DateTime::parse_from_rfc3339("2021-11-11T11:10:41+00:00")
33                                                        .expect("Failed to parse datetime")
34                                                        .with_timezone(&Utc),
35                                                    CIAppPipelineEventPipelineLevel::PIPELINE,
36                                                    "Deploy to AWS".to_string(),
37                                                    false,
38                                                    DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
39                                                        .expect("Failed to parse datetime")
40                                                        .with_timezone(&Utc),
41                                                    CIAppPipelineEventPipelineStatus::SUCCESS,
42                                                    "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
43                                                    "https://my-ci-provider.example/pipelines/my-pipeline/run/1".to_string(),
44                                                ).git(
45                                                    Some(
46                                                        CIAppGitInfo::new(
47                                                            "john.doe@email.com".to_string(),
48                                                            "https://github.com/DataDog/datadog-agent".to_string(),
49                                                            "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
50                                                        ),
51                                                    ),
52                                                ),
53                                            ),
54                                        ),
55                                    ),
56                                ),
57                            ),
58                        )
59                        .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
60                ),
61            ),
62        );
63    let configuration = datadog::Configuration::new();
64    let api = CIVisibilityPipelinesAPI::with_config(configuration);
65    let resp = api.create_ci_app_pipeline_event(body).await;
66    if let Ok(value) = resp {
67        println!("{:#?}", value);
68    } else {
69        println!("{:#?}", resp.unwrap_err());
70    }
71}
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent_819339921.rs (lines 47-51)
19async fn main() {
20    let body =
21        CIAppCreatePipelineEventRequest
22        ::new().data(
23            CIAppCreatePipelineEventRequestDataSingleOrArray::CIAppCreatePipelineEventRequestData(
24                Box::new(
25                    CIAppCreatePipelineEventRequestData::new()
26                        .attributes(
27                            CIAppCreatePipelineEventRequestAttributes::new(
28                                CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
29                                    Box::new(
30                                        CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(
31                                            Box::new(
32                                                CIAppPipelineEventFinishedPipeline::new(
33                                                    DateTime::parse_from_rfc3339("2021-11-11T11:10:41+00:00")
34                                                        .expect("Failed to parse datetime")
35                                                        .with_timezone(&Utc),
36                                                    CIAppPipelineEventPipelineLevel::PIPELINE,
37                                                    "Deploy to AWS".to_string(),
38                                                    false,
39                                                    DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
40                                                        .expect("Failed to parse datetime")
41                                                        .with_timezone(&Utc),
42                                                    CIAppPipelineEventPipelineStatus::SUCCESS,
43                                                    "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
44                                                    "https://my-ci-provider.example/pipelines/my-pipeline/run/1".to_string(),
45                                                ).git(
46                                                    Some(
47                                                        CIAppGitInfo::new(
48                                                            "john.doe@email.com".to_string(),
49                                                            "https://github.com/DataDog/datadog-agent".to_string(),
50                                                            "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
51                                                        ),
52                                                    ),
53                                                ),
54                                            ),
55                                        ),
56                                    ),
57                                ),
58                            ).provider_name("example-provider".to_string()),
59                        )
60                        .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
61                ),
62            ),
63        );
64    let configuration = datadog::Configuration::new();
65    let api = CIVisibilityPipelinesAPI::with_config(configuration);
66    let resp = api.create_ci_app_pipeline_event(body).await;
67    if let Ok(value) = resp {
68        println!("{:#?}", value);
69    } else {
70        println!("{:#?}", resp.unwrap_err());
71    }
72}
examples/v2_ci-visibility-pipelines_CreateCIAppPipelineEvent_2836340212.rs (lines 46-50)
18async fn main() {
19    let body =
20        CIAppCreatePipelineEventRequest
21        ::new().data(
22            CIAppCreatePipelineEventRequestDataSingleOrArray::CIAppCreatePipelineEventRequestDataArray(
23                vec![
24                    CIAppCreatePipelineEventRequestData::new()
25                        .attributes(
26                            CIAppCreatePipelineEventRequestAttributes::new(
27                                CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
28                                    Box::new(
29                                        CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(
30                                            Box::new(
31                                                CIAppPipelineEventFinishedPipeline::new(
32                                                    DateTime::parse_from_rfc3339("2021-11-11T11:10:41+00:00")
33                                                        .expect("Failed to parse datetime")
34                                                        .with_timezone(&Utc),
35                                                    CIAppPipelineEventPipelineLevel::PIPELINE,
36                                                    "Deploy to AWS".to_string(),
37                                                    false,
38                                                    DateTime::parse_from_rfc3339("2021-11-11T11:09:11+00:00")
39                                                        .expect("Failed to parse datetime")
40                                                        .with_timezone(&Utc),
41                                                    CIAppPipelineEventPipelineStatus::SUCCESS,
42                                                    "3eacb6f3-ff04-4e10-8a9c-46e6d054024a".to_string(),
43                                                    "https://my-ci-provider.example/pipelines/my-pipeline/run/1".to_string(),
44                                                ).git(
45                                                    Some(
46                                                        CIAppGitInfo::new(
47                                                            "john.doe@email.com".to_string(),
48                                                            "https://github.com/DataDog/datadog-agent".to_string(),
49                                                            "7f263865994b76066c4612fd1965215e7dcb4cd2".to_string(),
50                                                        ),
51                                                    ),
52                                                ),
53                                            ),
54                                        ),
55                                    ),
56                                ),
57                            ).provider_name("example-provider".to_string()),
58                        )
59                        .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST),
60                    CIAppCreatePipelineEventRequestData::new()
61                        .attributes(
62                            CIAppCreatePipelineEventRequestAttributes::new(
63                                CIAppCreatePipelineEventRequestAttributesResource::CIAppPipelineEventPipeline(
64                                    Box::new(
65                                        CIAppPipelineEventPipeline::CIAppPipelineEventFinishedPipeline(
66                                            Box::new(
67                                                CIAppPipelineEventFinishedPipeline::new(
68                                                    DateTime::parse_from_rfc3339("2021-11-11T11:10:26+00:00")
69                                                        .expect("Failed to parse datetime")
70                                                        .with_timezone(&Utc),
71                                                    CIAppPipelineEventPipelineLevel::PIPELINE,
72                                                    "Deploy to Production".to_string(),
73                                                    false,
74                                                    DateTime::parse_from_rfc3339("2021-11-11T11:08:11+00:00")
75                                                        .expect("Failed to parse datetime")
76                                                        .with_timezone(&Utc),
77                                                    CIAppPipelineEventPipelineStatus::SUCCESS,
78                                                    "7b2c8f9e-aa15-4d22-9c7d-83f4e065138b".to_string(),
79                                                    "https://my-ci-provider.example/pipelines/prod-pipeline/run/2".to_string(),
80                                                ).git(
81                                                    Some(
82                                                        CIAppGitInfo::new(
83                                                            "jane.smith@email.com".to_string(),
84                                                            "https://github.com/DataDog/datadog-agent".to_string(),
85                                                            "9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e".to_string(),
86                                                        ),
87                                                    ),
88                                                ),
89                                            ),
90                                        ),
91                                    ),
92                                ),
93                            ).provider_name("example-provider".to_string()),
94                        )
95                        .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST)
96                ],
97            ),
98        );
99    let configuration = datadog::Configuration::new();
100    let api = CIVisibilityPipelinesAPI::with_config(configuration);
101    let resp = api.create_ci_app_pipeline_event(body).await;
102    if let Ok(value) = resp {
103        println!("{:#?}", value);
104    } else {
105        println!("{:#?}", resp.unwrap_err());
106    }
107}
Source

pub fn author_name(self, value: Option<String>) -> Self

Source

pub fn author_time(self, value: Option<String>) -> Self

Source

pub fn branch(self, value: Option<String>) -> Self

Source

pub fn commit_time(self, value: Option<String>) -> Self

Source

pub fn committer_email(self, value: Option<String>) -> Self

Source

pub fn committer_name(self, value: Option<String>) -> Self

Source

pub fn default_branch(self, value: Option<String>) -> Self

Source

pub fn message(self, value: Option<String>) -> Self

Source

pub fn tag(self, value: Option<String>) -> Self

Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for CIAppGitInfo

Source§

fn clone(&self) -> CIAppGitInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CIAppGitInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CIAppGitInfo

Source§

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

Source§

fn eq(&self, other: &CIAppGitInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CIAppGitInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CIAppGitInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,