Skip to main content

nominal_api/conjure/clients/scout/
internal_versioning_service.rs

1use conjure_http::endpoint;
2/// These endpoints are not intended to be used directly by clients, since
3/// they require saving resource-specific state associated with new commits.
4#[conjure_http::conjure_client(name = "InternalVersioningService")]
5pub trait InternalVersioningService<
6    #[response_body]
7    I: Iterator<
8            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
9        >,
10> {
11    /// Creates a root commit (no parents) and a "main" branch
12    /// pointing to that commit, for the given resource.
13    /// Throws if the resource already has a commit graph.
14    #[endpoint(
15        method = POST,
16        path = "/internal/scout/v1/versioning/{resourceRid}",
17        name = "initResourceVersioning",
18        accept = conjure_http::client::StdResponseDeserializer
19    )]
20    fn init_resource_versioning(
21        &self,
22        #[auth]
23        auth_: &conjure_object::BearerToken,
24        #[path(
25            name = "resourceRid",
26            encoder = conjure_http::client::conjure::PlainEncoder
27        )]
28        resource_rid: &conjure_object::ResourceIdentifier,
29        #[body(serializer = conjure_http::client::StdRequestSerializer)]
30        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
31    ) -> Result<
32        super::super::super::objects::scout::versioning::api::BranchAndCommit,
33        conjure_http::private::Error,
34    >;
35    /// Creates a non-permanent commit on the given branch,
36    /// Throws if the branch doesn't exist.
37    /// Throws if latestCommit is passed and is not the latest commit.
38    #[endpoint(
39        method = POST,
40        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
41        name = "saveWorkingState",
42        accept = conjure_http::client::StdResponseDeserializer
43    )]
44    fn save_working_state(
45        &self,
46        #[auth]
47        auth_: &conjure_object::BearerToken,
48        #[path(
49            name = "resourceRid",
50            encoder = conjure_http::client::conjure::PlainEncoder
51        )]
52        resource_rid: &conjure_object::ResourceIdentifier,
53        #[path(
54            name = "branchName",
55            encoder = conjure_http::client::conjure::PlainEncoder
56        )]
57        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
58        #[body(serializer = conjure_http::client::StdRequestSerializer)]
59        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
60    ) -> Result<
61        super::super::super::objects::scout::versioning::api::BranchAndCommit,
62        conjure_http::private::Error,
63    >;
64    /// Creates a new permanent commit on the given branch.
65    /// Throws if the branch doesn't exist.
66    /// Throws if latestCommit is passed and is not the latest commit.
67    #[endpoint(
68        method = POST,
69        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
70        name = "commit",
71        accept = conjure_http::client::StdResponseDeserializer
72    )]
73    fn commit(
74        &self,
75        #[auth]
76        auth_: &conjure_object::BearerToken,
77        #[path(
78            name = "resourceRid",
79            encoder = conjure_http::client::conjure::PlainEncoder
80        )]
81        resource_rid: &conjure_object::ResourceIdentifier,
82        #[path(
83            name = "branchName",
84            encoder = conjure_http::client::conjure::PlainEncoder
85        )]
86        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
87        #[body(serializer = conjure_http::client::StdRequestSerializer)]
88        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
89    ) -> Result<
90        super::super::super::objects::scout::versioning::api::BranchAndCommit,
91        conjure_http::private::Error,
92    >;
93    /// Compacts the commit graph for the resource by deleting
94    /// working state commits that match the provided strategy.
95    /// Persists commits that are pointed to by branches.
96    /// Returns the set of commits that were compacted.
97    /// Throws if the resource doesn't exist.
98    #[endpoint(
99        method = POST,
100        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
101        name = "compactCommits",
102        accept = conjure_http::client::conjure::CollectionResponseDeserializer
103    )]
104    fn compact_commits(
105        &self,
106        #[auth]
107        auth_: &conjure_object::BearerToken,
108        #[path(
109            name = "resourceRid",
110            encoder = conjure_http::client::conjure::PlainEncoder
111        )]
112        resource_rid: &conjure_object::ResourceIdentifier,
113        #[body(serializer = conjure_http::client::StdRequestSerializer)]
114        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
115    ) -> Result<
116        std::collections::BTreeSet<
117            super::super::super::objects::scout::versioning::api::CommitId,
118        >,
119        conjure_http::private::Error,
120    >;
121}
122/// These endpoints are not intended to be used directly by clients, since
123/// they require saving resource-specific state associated with new commits.
124#[conjure_http::conjure_client(name = "InternalVersioningService")]
125pub trait AsyncInternalVersioningService<
126    #[response_body]
127    I: conjure_http::private::Stream<
128            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
129        >,
130> {
131    /// Creates a root commit (no parents) and a "main" branch
132    /// pointing to that commit, for the given resource.
133    /// Throws if the resource already has a commit graph.
134    #[endpoint(
135        method = POST,
136        path = "/internal/scout/v1/versioning/{resourceRid}",
137        name = "initResourceVersioning",
138        accept = conjure_http::client::StdResponseDeserializer
139    )]
140    async fn init_resource_versioning(
141        &self,
142        #[auth]
143        auth_: &conjure_object::BearerToken,
144        #[path(
145            name = "resourceRid",
146            encoder = conjure_http::client::conjure::PlainEncoder
147        )]
148        resource_rid: &conjure_object::ResourceIdentifier,
149        #[body(serializer = conjure_http::client::StdRequestSerializer)]
150        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
151    ) -> Result<
152        super::super::super::objects::scout::versioning::api::BranchAndCommit,
153        conjure_http::private::Error,
154    >;
155    /// Creates a non-permanent commit on the given branch,
156    /// Throws if the branch doesn't exist.
157    /// Throws if latestCommit is passed and is not the latest commit.
158    #[endpoint(
159        method = POST,
160        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
161        name = "saveWorkingState",
162        accept = conjure_http::client::StdResponseDeserializer
163    )]
164    async fn save_working_state(
165        &self,
166        #[auth]
167        auth_: &conjure_object::BearerToken,
168        #[path(
169            name = "resourceRid",
170            encoder = conjure_http::client::conjure::PlainEncoder
171        )]
172        resource_rid: &conjure_object::ResourceIdentifier,
173        #[path(
174            name = "branchName",
175            encoder = conjure_http::client::conjure::PlainEncoder
176        )]
177        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
178        #[body(serializer = conjure_http::client::StdRequestSerializer)]
179        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
180    ) -> Result<
181        super::super::super::objects::scout::versioning::api::BranchAndCommit,
182        conjure_http::private::Error,
183    >;
184    /// Creates a new permanent commit on the given branch.
185    /// Throws if the branch doesn't exist.
186    /// Throws if latestCommit is passed and is not the latest commit.
187    #[endpoint(
188        method = POST,
189        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
190        name = "commit",
191        accept = conjure_http::client::StdResponseDeserializer
192    )]
193    async fn commit(
194        &self,
195        #[auth]
196        auth_: &conjure_object::BearerToken,
197        #[path(
198            name = "resourceRid",
199            encoder = conjure_http::client::conjure::PlainEncoder
200        )]
201        resource_rid: &conjure_object::ResourceIdentifier,
202        #[path(
203            name = "branchName",
204            encoder = conjure_http::client::conjure::PlainEncoder
205        )]
206        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
207        #[body(serializer = conjure_http::client::StdRequestSerializer)]
208        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
209    ) -> Result<
210        super::super::super::objects::scout::versioning::api::BranchAndCommit,
211        conjure_http::private::Error,
212    >;
213    /// Compacts the commit graph for the resource by deleting
214    /// working state commits that match the provided strategy.
215    /// Persists commits that are pointed to by branches.
216    /// Returns the set of commits that were compacted.
217    /// Throws if the resource doesn't exist.
218    #[endpoint(
219        method = POST,
220        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
221        name = "compactCommits",
222        accept = conjure_http::client::conjure::CollectionResponseDeserializer
223    )]
224    async fn compact_commits(
225        &self,
226        #[auth]
227        auth_: &conjure_object::BearerToken,
228        #[path(
229            name = "resourceRid",
230            encoder = conjure_http::client::conjure::PlainEncoder
231        )]
232        resource_rid: &conjure_object::ResourceIdentifier,
233        #[body(serializer = conjure_http::client::StdRequestSerializer)]
234        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
235    ) -> Result<
236        std::collections::BTreeSet<
237            super::super::super::objects::scout::versioning::api::CommitId,
238        >,
239        conjure_http::private::Error,
240    >;
241}
242/// These endpoints are not intended to be used directly by clients, since
243/// they require saving resource-specific state associated with new commits.
244#[conjure_http::conjure_client(name = "InternalVersioningService", local)]
245pub trait LocalAsyncInternalVersioningService<
246    #[response_body]
247    I: conjure_http::private::Stream<
248            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
249        >,
250> {
251    /// Creates a root commit (no parents) and a "main" branch
252    /// pointing to that commit, for the given resource.
253    /// Throws if the resource already has a commit graph.
254    #[endpoint(
255        method = POST,
256        path = "/internal/scout/v1/versioning/{resourceRid}",
257        name = "initResourceVersioning",
258        accept = conjure_http::client::StdResponseDeserializer
259    )]
260    async fn init_resource_versioning(
261        &self,
262        #[auth]
263        auth_: &conjure_object::BearerToken,
264        #[path(
265            name = "resourceRid",
266            encoder = conjure_http::client::conjure::PlainEncoder
267        )]
268        resource_rid: &conjure_object::ResourceIdentifier,
269        #[body(serializer = conjure_http::client::StdRequestSerializer)]
270        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
271    ) -> Result<
272        super::super::super::objects::scout::versioning::api::BranchAndCommit,
273        conjure_http::private::Error,
274    >;
275    /// Creates a non-permanent commit on the given branch,
276    /// Throws if the branch doesn't exist.
277    /// Throws if latestCommit is passed and is not the latest commit.
278    #[endpoint(
279        method = POST,
280        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
281        name = "saveWorkingState",
282        accept = conjure_http::client::StdResponseDeserializer
283    )]
284    async fn save_working_state(
285        &self,
286        #[auth]
287        auth_: &conjure_object::BearerToken,
288        #[path(
289            name = "resourceRid",
290            encoder = conjure_http::client::conjure::PlainEncoder
291        )]
292        resource_rid: &conjure_object::ResourceIdentifier,
293        #[path(
294            name = "branchName",
295            encoder = conjure_http::client::conjure::PlainEncoder
296        )]
297        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
298        #[body(serializer = conjure_http::client::StdRequestSerializer)]
299        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
300    ) -> Result<
301        super::super::super::objects::scout::versioning::api::BranchAndCommit,
302        conjure_http::private::Error,
303    >;
304    /// Creates a new permanent commit on the given branch.
305    /// Throws if the branch doesn't exist.
306    /// Throws if latestCommit is passed and is not the latest commit.
307    #[endpoint(
308        method = POST,
309        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
310        name = "commit",
311        accept = conjure_http::client::StdResponseDeserializer
312    )]
313    async fn commit(
314        &self,
315        #[auth]
316        auth_: &conjure_object::BearerToken,
317        #[path(
318            name = "resourceRid",
319            encoder = conjure_http::client::conjure::PlainEncoder
320        )]
321        resource_rid: &conjure_object::ResourceIdentifier,
322        #[path(
323            name = "branchName",
324            encoder = conjure_http::client::conjure::PlainEncoder
325        )]
326        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
327        #[body(serializer = conjure_http::client::StdRequestSerializer)]
328        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
329    ) -> Result<
330        super::super::super::objects::scout::versioning::api::BranchAndCommit,
331        conjure_http::private::Error,
332    >;
333    /// Compacts the commit graph for the resource by deleting
334    /// working state commits that match the provided strategy.
335    /// Persists commits that are pointed to by branches.
336    /// Returns the set of commits that were compacted.
337    /// Throws if the resource doesn't exist.
338    #[endpoint(
339        method = POST,
340        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
341        name = "compactCommits",
342        accept = conjure_http::client::conjure::CollectionResponseDeserializer
343    )]
344    async fn compact_commits(
345        &self,
346        #[auth]
347        auth_: &conjure_object::BearerToken,
348        #[path(
349            name = "resourceRid",
350            encoder = conjure_http::client::conjure::PlainEncoder
351        )]
352        resource_rid: &conjure_object::ResourceIdentifier,
353        #[body(serializer = conjure_http::client::StdRequestSerializer)]
354        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
355    ) -> Result<
356        std::collections::BTreeSet<
357            super::super::super::objects::scout::versioning::api::CommitId,
358        >,
359        conjure_http::private::Error,
360    >;
361}