1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//! GitLab integration for Ironflow workflows.
//!
//! This crate provides a thin integration layer between the
//! [`gitlab`](https://crates.io/crates/gitlab) crate and Ironflow's workflow
//! engine. It re-exports the full `gitlab` API so that workflow handlers get
//! typed, builder-based access to every GitLab endpoint without managing
//! authentication or HTTP clients manually.
//!
//! # Quick start
//!
//! ```no_run
//! use ironflow_ops_gitlab::GitLab;
//! use ironflow_core::operation::{OperationContext, NoopSecretResolver};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
//! let gitlab = GitLab::from_context(&ctx).await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Typed queries
//!
//! Use the re-exported [`gitlab::api`] builders and [`gitlab::api::AsyncQuery`] to call any
//! endpoint with a typed response:
//!
//! ```no_run
//! use ironflow_ops_gitlab::GitLab;
//! use gitlab::api::{projects, AsyncQuery};
//! use ironflow_core::operation::{OperationContext, NoopSecretResolver};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
//! let gitlab = GitLab::from_context(&ctx).await?;
//!
//! let endpoint = projects::Project::builder().project(42).build()?;
//! let project: serde_json::Value = endpoint.query_async(gitlab.client()).await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Tracked operations
//!
//! Wrap any endpoint in [`GitLabOp`] to execute it as a tracked workflow step
//! via `WorkflowContext::operation()`:
//!
//! ```no_run
//! use ironflow_ops_gitlab::GitLab;
//! use gitlab::api::projects;
//! use ironflow_core::operation::{OperationContext, NoopSecretResolver};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
//! let gitlab = GitLab::from_context(&ctx).await?;
//!
//! let endpoint = projects::Project::builder().project(42).build()?;
//! let op = gitlab.op(endpoint);
//! // op implements Operation -- pass it to ctx.operation("get-project", &op)
//! # Ok(())
//! # }
//! ```
//!
//! # Missing endpoints
//!
//! Some GitLab REST routes are not implemented by the `gitlab` crate. This crate fills
//! those gaps under [`endpoints`], wired the same way as any other endpoint:
//!
//! ```no_run
//! use ironflow_ops_gitlab::GitLab;
//! use ironflow_ops_gitlab::endpoints::merge_requests::CreateMergeRequestDiscussionNote;
//! use gitlab::api::common::NameOrId;
//! use ironflow_core::operation::{OperationContext, NoopSecretResolver};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
//! let gitlab = GitLab::from_context(&ctx).await?;
//!
//! let endpoint = CreateMergeRequestDiscussionNote {
//! project: NameOrId::from(42),
//! merge_request: 7,
//! discussion_id: "abcd1234".to_string(),
//! body: "Looks good, thanks!".to_string(),
//! };
//! let op = gitlab.op(endpoint);
//! # Ok(())
//! # }
//! ```
//!
//! # Paginated operations
//!
//! Use [`GitLab::paged_op`] to drive a pageable "list ..." endpoint across every page and
//! get back a single JSON array concatenating every page's results:
//!
//! ```no_run
//! use ironflow_ops_gitlab::GitLab;
//! use gitlab::api::projects::merge_requests::MergeRequests;
//! use gitlab::api::Pagination;
//! use ironflow_core::operation::{OperationContext, NoopSecretResolver};
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
//! let gitlab = GitLab::from_context(&ctx).await?;
//!
//! let endpoint = MergeRequests::builder().project(42).build()?;
//! let op = gitlab.paged_op(endpoint, Pagination::All);
//! // op.execute(..) returns a Value::Array concatenating every page
//! # Ok(())
//! # }
//! ```
pub use GitLab;
pub use gitlab;
pub use GitLabOp;
pub use GitLabPagedOp;