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 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
Hide additional 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}
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,