Skip to main content

nominal_api_proto/proto/
nominal.plan.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Plan {
4    #[prost(string, tag = "1")]
5    pub rid: ::prost::alloc::string::String,
6    #[prost(message, optional, tag = "2")]
7    pub metadata: ::core::option::Option<PlanMetadata>,
8    #[prost(message, optional, tag = "3")]
9    pub commit: ::core::option::Option<super::super::versioning::v1::Commit>,
10    #[prost(message, optional, tag = "4")]
11    pub content: ::core::option::Option<PlanContent>,
12}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct PlanSummary {
15    #[prost(string, tag = "1")]
16    pub rid: ::prost::alloc::string::String,
17    #[prost(message, optional, tag = "2")]
18    pub metadata: ::core::option::Option<PlanMetadata>,
19}
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct PlanMetadata {
22    #[prost(string, tag = "1")]
23    pub title: ::prost::alloc::string::String,
24    #[prost(string, tag = "2")]
25    pub description: ::prost::alloc::string::String,
26    #[prost(string, repeated, tag = "3")]
27    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
28    #[prost(map = "string, string", tag = "4")]
29    pub properties: ::std::collections::HashMap<
30        ::prost::alloc::string::String,
31        ::prost::alloc::string::String,
32    >,
33    #[prost(bool, tag = "5")]
34    pub is_archived: bool,
35    #[prost(bool, optional, tag = "6")]
36    pub is_published: ::core::option::Option<bool>,
37    #[prost(string, tag = "7")]
38    pub created_by: ::prost::alloc::string::String,
39    #[prost(message, optional, tag = "8")]
40    pub created_at: ::core::option::Option<
41        super::super::super::google::protobuf::Timestamp,
42    >,
43    #[prost(message, optional, tag = "9")]
44    pub updated_at: ::core::option::Option<
45        super::super::super::google::protobuf::Timestamp,
46    >,
47    #[prost(message, optional, tag = "10")]
48    pub edited_at: ::core::option::Option<
49        super::super::super::google::protobuf::Timestamp,
50    >,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct PlanContent {
54    #[prost(oneof = "plan_content::PlanContent", tags = "1")]
55    pub plan_content: ::core::option::Option<plan_content::PlanContent>,
56}
57/// Nested message and enum types in `PlanContent`.
58pub mod plan_content {
59    #[derive(Clone, PartialEq, ::prost::Oneof)]
60    pub enum PlanContent {
61        #[prost(message, tag = "1")]
62        V1(super::PlanContentV1),
63    }
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct PlanContentV1 {
67    #[prost(message, optional, tag = "1")]
68    pub start_date: ::core::option::Option<
69        super::super::super::google::protobuf::Timestamp,
70    >,
71    #[prost(message, optional, tag = "2")]
72    pub end_date: ::core::option::Option<
73        super::super::super::google::protobuf::Timestamp,
74    >,
75    #[prost(message, repeated, tag = "3")]
76    pub objectives: ::prost::alloc::vec::Vec<Objective>,
77    #[prost(message, repeated, tag = "4")]
78    pub events: ::prost::alloc::vec::Vec<Event>,
79    #[prost(message, repeated, tag = "5")]
80    pub segments: ::prost::alloc::vec::Vec<Segment>,
81    #[prost(message, repeated, tag = "6")]
82    pub asset_groups: ::prost::alloc::vec::Vec<AssetGroup>,
83    #[prost(message, repeated, tag = "7")]
84    pub milestones: ::prost::alloc::vec::Vec<Milestone>,
85}
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct Milestone {
88    #[prost(string, tag = "1")]
89    pub id: ::prost::alloc::string::String,
90    #[prost(string, tag = "2")]
91    pub name: ::prost::alloc::string::String,
92    #[prost(string, optional, tag = "3")]
93    pub description: ::core::option::Option<::prost::alloc::string::String>,
94}
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct Event {
97    #[prost(string, tag = "1")]
98    pub id: ::prost::alloc::string::String,
99    #[prost(string, tag = "2")]
100    pub name: ::prost::alloc::string::String,
101    #[prost(string, optional, tag = "3")]
102    pub description: ::core::option::Option<::prost::alloc::string::String>,
103    #[prost(message, optional, tag = "4")]
104    pub details: ::core::option::Option<EventDetails>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct EventDetails {
108    #[prost(oneof = "event_details::EventDetails", tags = "1")]
109    pub event_details: ::core::option::Option<event_details::EventDetails>,
110}
111/// Nested message and enum types in `EventDetails`.
112pub mod event_details {
113    #[derive(Clone, PartialEq, ::prost::Oneof)]
114    pub enum EventDetails {
115        #[prost(message, tag = "1")]
116        Single(super::SingleEvent),
117    }
118}
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct SingleEvent {
121    #[prost(message, optional, tag = "1")]
122    pub start_date: ::core::option::Option<
123        super::super::super::google::protobuf::Timestamp,
124    >,
125    #[prost(message, optional, tag = "2")]
126    pub end_date: ::core::option::Option<
127        super::super::super::google::protobuf::Timestamp,
128    >,
129    #[prost(string, optional, tag = "3")]
130    pub segment_id: ::core::option::Option<::prost::alloc::string::String>,
131    #[prost(string, repeated, tag = "4")]
132    pub objective_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
133    #[prost(message, optional, tag = "5")]
134    pub status: ::core::option::Option<EventStatus>,
135}
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct EventStatus {
138    #[prost(oneof = "event_status::EventStatus", tags = "1, 2, 3, 4, 5")]
139    pub event_status: ::core::option::Option<event_status::EventStatus>,
140}
141/// Nested message and enum types in `EventStatus`.
142pub mod event_status {
143    #[derive(Clone, PartialEq, ::prost::Oneof)]
144    pub enum EventStatus {
145        #[prost(message, tag = "1")]
146        Created(super::CreatedEvent),
147        #[prost(message, tag = "2")]
148        Finalized(super::FinalizedEvent),
149        #[prost(message, tag = "3")]
150        InProgress(super::InProgressEvent),
151        #[prost(message, tag = "4")]
152        Completed(super::CompletedEvent),
153        #[prost(message, tag = "5")]
154        Cancelled(super::CancelledEvent),
155    }
156}
157#[derive(Clone, Copy, PartialEq, ::prost::Message)]
158pub struct CreatedEvent {}
159#[derive(Clone, Copy, PartialEq, ::prost::Message)]
160pub struct FinalizedEvent {}
161#[derive(Clone, Copy, PartialEq, ::prost::Message)]
162pub struct InProgressEvent {}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct CompletedEvent {
165    #[prost(string, optional, tag = "1")]
166    pub notes: ::core::option::Option<::prost::alloc::string::String>,
167}
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct CancelledEvent {
170    #[prost(string, tag = "1")]
171    pub reason: ::prost::alloc::string::String,
172    #[prost(string, optional, tag = "2")]
173    pub notes: ::core::option::Option<::prost::alloc::string::String>,
174}
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct Objective {
177    #[prost(string, tag = "1")]
178    pub id: ::prost::alloc::string::String,
179    #[prost(string, tag = "2")]
180    pub name: ::prost::alloc::string::String,
181    #[prost(string, tag = "3")]
182    pub creator: ::prost::alloc::string::String,
183    #[prost(message, optional, tag = "4")]
184    pub created_at: ::core::option::Option<
185        super::super::super::google::protobuf::Timestamp,
186    >,
187    #[prost(enumeration = "super::super::types::Priority", tag = "5")]
188    pub priority: i32,
189    #[prost(string, repeated, tag = "6")]
190    pub milestone_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
191    #[prost(string, optional, tag = "7")]
192    pub description: ::core::option::Option<::prost::alloc::string::String>,
193    #[prost(message, optional, tag = "8")]
194    pub details: ::core::option::Option<ObjectiveDetails>,
195    #[prost(message, optional, tag = "9")]
196    pub status: ::core::option::Option<ObjectiveStatus>,
197}
198#[derive(Clone, PartialEq, ::prost::Message)]
199pub struct ObjectiveStatus {
200    #[prost(oneof = "objective_status::ObjectiveStatus", tags = "1, 2, 3, 4, 5")]
201    pub objective_status: ::core::option::Option<objective_status::ObjectiveStatus>,
202}
203/// Nested message and enum types in `ObjectiveStatus`.
204pub mod objective_status {
205    #[derive(Clone, PartialEq, ::prost::Oneof)]
206    pub enum ObjectiveStatus {
207        #[prost(message, tag = "1")]
208        Draft(super::DraftObjective),
209        #[prost(message, tag = "2")]
210        Proposed(super::ProposedObjective),
211        #[prost(message, tag = "3")]
212        Finalized(super::FinalizedObjective),
213        #[prost(message, tag = "4")]
214        Completed(super::CompletedObjective),
215        #[prost(message, tag = "5")]
216        Rejected(super::RejectedObjective),
217    }
218}
219#[derive(Clone, Copy, PartialEq, ::prost::Message)]
220pub struct DraftObjective {}
221#[derive(Clone, Copy, PartialEq, ::prost::Message)]
222pub struct ProposedObjective {}
223#[derive(Clone, Copy, PartialEq, ::prost::Message)]
224pub struct FinalizedObjective {}
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct CompletedObjective {
227    #[prost(message, optional, tag = "1")]
228    pub disposition: ::core::option::Option<ObjectiveDisposition>,
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct RejectedObjective {
232    #[prost(string, tag = "1")]
233    pub reason: ::prost::alloc::string::String,
234}
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct ObjectiveDisposition {
237    #[prost(oneof = "objective_disposition::ObjectiveDisposition", tags = "1, 2")]
238    pub objective_disposition: ::core::option::Option<
239        objective_disposition::ObjectiveDisposition,
240    >,
241}
242/// Nested message and enum types in `ObjectiveDisposition`.
243pub mod objective_disposition {
244    #[derive(Clone, PartialEq, ::prost::Oneof)]
245    pub enum ObjectiveDisposition {
246        #[prost(message, tag = "1")]
247        Successful(super::SuccessfulObjective),
248        #[prost(message, tag = "2")]
249        Failed(super::FailedObjective),
250    }
251}
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct SuccessfulObjective {
254    #[prost(string, optional, tag = "1")]
255    pub notes: ::core::option::Option<::prost::alloc::string::String>,
256}
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct FailedObjective {
259    #[prost(string, tag = "1")]
260    pub reason: ::prost::alloc::string::String,
261    #[prost(string, optional, tag = "2")]
262    pub notes: ::core::option::Option<::prost::alloc::string::String>,
263}
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct ObjectiveDetails {
266    #[prost(oneof = "objective_details::ObjectiveDetails", tags = "1")]
267    pub objective_details: ::core::option::Option<objective_details::ObjectiveDetails>,
268}
269/// Nested message and enum types in `ObjectiveDetails`.
270pub mod objective_details {
271    #[derive(Clone, PartialEq, ::prost::Oneof)]
272    pub enum ObjectiveDetails {
273        #[prost(message, tag = "1")]
274        Simple(super::SimpleObjective),
275    }
276}
277#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct SimpleObjective {
279    #[prost(message, repeated, tag = "1")]
280    pub resources: ::prost::alloc::vec::Vec<Resource>,
281}
282#[derive(Clone, PartialEq, ::prost::Message)]
283pub struct Resource {
284    #[prost(string, tag = "1")]
285    pub name: ::prost::alloc::string::String,
286    #[prost(string, optional, tag = "2")]
287    pub description: ::core::option::Option<::prost::alloc::string::String>,
288    #[prost(int32, optional, tag = "3")]
289    pub count: ::core::option::Option<i32>,
290    #[prost(message, optional, tag = "4")]
291    pub candidate_assets: ::core::option::Option<CandidateAssetGroup>,
292    #[prost(string, repeated, tag = "5")]
293    pub finalized_asset_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
294}
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct CandidateAssetGroup {
297    #[prost(oneof = "candidate_asset_group::CandidateAssetGroup", tags = "1, 2")]
298    pub candidate_asset_group: ::core::option::Option<
299        candidate_asset_group::CandidateAssetGroup,
300    >,
301}
302/// Nested message and enum types in `CandidateAssetGroup`.
303pub mod candidate_asset_group {
304    #[derive(Clone, PartialEq, ::prost::Oneof)]
305    pub enum CandidateAssetGroup {
306        #[prost(message, tag = "1")]
307        Sources(super::AssetSourceList),
308        #[prost(string, tag = "2")]
309        AssetGroupId(::prost::alloc::string::String),
310    }
311}
312#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct AssetSourceList {
314    #[prost(message, repeated, tag = "1")]
315    pub sources: ::prost::alloc::vec::Vec<AssetSource>,
316}
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct AssetGroup {
319    #[prost(string, tag = "1")]
320    pub id: ::prost::alloc::string::String,
321    #[prost(string, tag = "2")]
322    pub name: ::prost::alloc::string::String,
323    #[prost(string, optional, tag = "3")]
324    pub description: ::core::option::Option<::prost::alloc::string::String>,
325    #[prost(message, repeated, tag = "4")]
326    pub sources: ::prost::alloc::vec::Vec<AssetSource>,
327}
328#[derive(Clone, PartialEq, ::prost::Message)]
329pub struct AssetSource {
330    #[prost(oneof = "asset_source::AssetSource", tags = "1, 2")]
331    pub asset_source: ::core::option::Option<asset_source::AssetSource>,
332}
333/// Nested message and enum types in `AssetSource`.
334pub mod asset_source {
335    #[derive(Clone, PartialEq, ::prost::Oneof)]
336    pub enum AssetSource {
337        #[prost(message, tag = "1")]
338        AssetSearch(super::super::super::asset::v2::SearchAssetsQuery),
339        #[prost(string, tag = "2")]
340        AssetRid(::prost::alloc::string::String),
341    }
342}
343#[derive(Clone, PartialEq, ::prost::Message)]
344pub struct Segment {
345    #[prost(string, tag = "1")]
346    pub id: ::prost::alloc::string::String,
347    #[prost(string, tag = "2")]
348    pub name: ::prost::alloc::string::String,
349    #[prost(message, optional, tag = "3")]
350    pub start_date: ::core::option::Option<
351        super::super::super::google::protobuf::Timestamp,
352    >,
353    #[prost(message, optional, tag = "4")]
354    pub end_date: ::core::option::Option<
355        super::super::super::google::protobuf::Timestamp,
356    >,
357    #[prost(message, optional, tag = "5")]
358    pub status: ::core::option::Option<SegmentStatus>,
359}
360#[derive(Clone, Copy, PartialEq, ::prost::Message)]
361pub struct SegmentStatus {
362    #[prost(oneof = "segment_status::SegmentStatus", tags = "1, 2")]
363    pub segment_status: ::core::option::Option<segment_status::SegmentStatus>,
364}
365/// Nested message and enum types in `SegmentStatus`.
366pub mod segment_status {
367    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
368    pub enum SegmentStatus {
369        #[prost(message, tag = "1")]
370        Draft(super::DraftSegment),
371        #[prost(message, tag = "2")]
372        Finalized(super::FinalizedSegment),
373    }
374}
375#[derive(Clone, Copy, PartialEq, ::prost::Message)]
376pub struct DraftSegment {}
377#[derive(Clone, Copy, PartialEq, ::prost::Message)]
378pub struct FinalizedSegment {}
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct CreatePlanRequest {
381    #[prost(message, optional, tag = "1")]
382    pub plan: ::core::option::Option<Plan>,
383    #[prost(string, tag = "2")]
384    pub message: ::prost::alloc::string::String,
385}
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct CreatePlanResponse {
388    #[prost(message, optional, tag = "1")]
389    pub plan: ::core::option::Option<Plan>,
390}
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct GetPlanRequest {
393    #[prost(string, tag = "1")]
394    pub plan_rid: ::prost::alloc::string::String,
395    #[prost(message, optional, tag = "2")]
396    pub at: ::core::option::Option<super::super::versioning::v1::BranchOrCommit>,
397}
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct GetPlanResponse {
400    #[prost(message, optional, tag = "1")]
401    pub plan: ::core::option::Option<Plan>,
402}
403#[derive(Clone, PartialEq, ::prost::Message)]
404pub struct BatchGetPlansRequest {
405    #[prost(string, repeated, tag = "1")]
406    pub plan_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
407}
408#[derive(Clone, PartialEq, ::prost::Message)]
409pub struct BatchGetPlansResponse {
410    #[prost(message, repeated, tag = "1")]
411    pub plans: ::prost::alloc::vec::Vec<Plan>,
412}
413#[derive(Clone, PartialEq, ::prost::Message)]
414pub struct CreatePlanCommitRequest {
415    #[prost(string, tag = "1")]
416    pub plan_rid: ::prost::alloc::string::String,
417    #[prost(message, optional, tag = "2")]
418    pub content: ::core::option::Option<PlanContent>,
419    #[prost(string, optional, tag = "3")]
420    pub branch: ::core::option::Option<::prost::alloc::string::String>,
421    #[prost(string, tag = "4")]
422    pub message: ::prost::alloc::string::String,
423    #[prost(bool, tag = "5")]
424    pub is_working_state: bool,
425    #[prost(string, optional, tag = "6")]
426    pub expected_latest_commit: ::core::option::Option<::prost::alloc::string::String>,
427}
428#[derive(Clone, PartialEq, ::prost::Message)]
429pub struct CreatePlanCommitResponse {
430    #[prost(message, optional, tag = "1")]
431    pub plan: ::core::option::Option<Plan>,
432}
433#[derive(Clone, PartialEq, ::prost::Message)]
434pub struct UpdatePlanMetadataRequest {
435    #[prost(string, tag = "1")]
436    pub plan_rid: ::prost::alloc::string::String,
437    #[prost(string, optional, tag = "2")]
438    pub title: ::core::option::Option<::prost::alloc::string::String>,
439    #[prost(string, optional, tag = "3")]
440    pub description: ::core::option::Option<::prost::alloc::string::String>,
441    #[prost(message, optional, tag = "4")]
442    pub labels: ::core::option::Option<super::super::types::LabelUpdateWrapper>,
443    #[prost(message, optional, tag = "5")]
444    pub properties: ::core::option::Option<super::super::types::PropertyUpdateWrapper>,
445    #[prost(bool, optional, tag = "6")]
446    pub is_archived: ::core::option::Option<bool>,
447    #[prost(bool, optional, tag = "7")]
448    pub is_published: ::core::option::Option<bool>,
449}
450#[derive(Clone, PartialEq, ::prost::Message)]
451pub struct UpdatePlanMetadataResponse {
452    #[prost(message, optional, tag = "1")]
453    pub metadata: ::core::option::Option<PlanMetadata>,
454}
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct SearchPlansQuery {
457    #[prost(
458        oneof = "search_plans_query::Query",
459        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12"
460    )]
461    pub query: ::core::option::Option<search_plans_query::Query>,
462}
463/// Nested message and enum types in `SearchPlansQuery`.
464pub mod search_plans_query {
465    #[derive(Clone, PartialEq, ::prost::Oneof)]
466    pub enum Query {
467        #[prost(message, tag = "1")]
468        And(super::SearchPlansQueryList),
469        #[prost(message, tag = "2")]
470        Or(super::SearchPlansQueryList),
471        #[prost(message, tag = "3")]
472        Not(::prost::alloc::boxed::Box<super::SearchPlansQuery>),
473        #[prost(string, tag = "4")]
474        ExactMatch(::prost::alloc::string::String),
475        #[prost(string, tag = "5")]
476        SearchText(::prost::alloc::string::String),
477        #[prost(message, tag = "6")]
478        Labels(super::super::super::types::LabelsFilter),
479        #[prost(message, tag = "7")]
480        Properties(super::super::super::types::PropertiesFilter),
481        #[prost(string, tag = "8")]
482        CreatedBy(::prost::alloc::string::String),
483        #[prost(bool, tag = "9")]
484        IsArchived(bool),
485        #[prost(bool, tag = "10")]
486        IsPublished(bool),
487        #[prost(bool, tag = "11")]
488        AuthorIsCurrentUser(bool),
489        #[prost(message, tag = "12")]
490        AuthorRids(super::UserRidList),
491    }
492}
493#[derive(Clone, PartialEq, ::prost::Message)]
494pub struct SearchPlansQueryList {
495    #[prost(message, repeated, tag = "1")]
496    pub queries: ::prost::alloc::vec::Vec<SearchPlansQuery>,
497}
498#[derive(Clone, PartialEq, ::prost::Message)]
499pub struct UserRidList {
500    #[prost(string, repeated, tag = "1")]
501    pub user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
502}
503#[derive(Clone, Copy, PartialEq, ::prost::Message)]
504pub struct PlanSortOptions {
505    #[prost(enumeration = "PlanSortField", tag = "1")]
506    pub field: i32,
507    #[prost(bool, tag = "2")]
508    pub is_descending: bool,
509}
510#[derive(Clone, PartialEq, ::prost::Message)]
511pub struct SearchPlansRequest {
512    #[prost(message, optional, tag = "1")]
513    pub query: ::core::option::Option<SearchPlansQuery>,
514    #[prost(message, optional, tag = "2")]
515    pub sort: ::core::option::Option<PlanSortOptions>,
516    #[prost(string, optional, tag = "3")]
517    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
518    #[prost(int32, optional, tag = "4")]
519    pub page_size: ::core::option::Option<i32>,
520}
521#[derive(Clone, PartialEq, ::prost::Message)]
522pub struct SearchPlansResponse {
523    #[prost(message, repeated, tag = "1")]
524    pub results: ::prost::alloc::vec::Vec<PlanSummary>,
525    #[prost(string, optional, tag = "2")]
526    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
527}
528#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
529#[repr(i32)]
530pub enum PlanSortField {
531    Unspecified = 0,
532    Name = 1,
533    CreatedAt = 2,
534    EditedAt = 3,
535}
536impl PlanSortField {
537    /// String value of the enum field names used in the ProtoBuf definition.
538    ///
539    /// The values are not transformed in any way and thus are considered stable
540    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
541    pub fn as_str_name(&self) -> &'static str {
542        match self {
543            Self::Unspecified => "PLAN_SORT_FIELD_UNSPECIFIED",
544            Self::Name => "NAME",
545            Self::CreatedAt => "CREATED_AT",
546            Self::EditedAt => "EDITED_AT",
547        }
548    }
549    /// Creates an enum from field names used in the ProtoBuf definition.
550    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
551        match value {
552            "PLAN_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
553            "NAME" => Some(Self::Name),
554            "CREATED_AT" => Some(Self::CreatedAt),
555            "EDITED_AT" => Some(Self::EditedAt),
556            _ => None,
557        }
558    }
559}
560#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
561#[repr(i32)]
562pub enum PlanError {
563    PlanNotFound = 0,
564    BranchOrCommitNotFound = 1,
565    CommitConflict = 2,
566    PlanArchived = 3,
567}
568impl PlanError {
569    /// String value of the enum field names used in the ProtoBuf definition.
570    ///
571    /// The values are not transformed in any way and thus are considered stable
572    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
573    pub fn as_str_name(&self) -> &'static str {
574        match self {
575            Self::PlanNotFound => "PLAN_ERROR_PLAN_NOT_FOUND",
576            Self::BranchOrCommitNotFound => "PLAN_ERROR_BRANCH_OR_COMMIT_NOT_FOUND",
577            Self::CommitConflict => "PLAN_ERROR_COMMIT_CONFLICT",
578            Self::PlanArchived => "PLAN_ERROR_PLAN_ARCHIVED",
579        }
580    }
581    /// Creates an enum from field names used in the ProtoBuf definition.
582    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
583        match value {
584            "PLAN_ERROR_PLAN_NOT_FOUND" => Some(Self::PlanNotFound),
585            "PLAN_ERROR_BRANCH_OR_COMMIT_NOT_FOUND" => Some(Self::BranchOrCommitNotFound),
586            "PLAN_ERROR_COMMIT_CONFLICT" => Some(Self::CommitConflict),
587            "PLAN_ERROR_PLAN_ARCHIVED" => Some(Self::PlanArchived),
588            _ => None,
589        }
590    }
591}
592/// Generated client implementations.
593pub mod plan_service_client {
594    #![allow(
595        unused_variables,
596        dead_code,
597        missing_docs,
598        clippy::wildcard_imports,
599        clippy::let_unit_value,
600    )]
601    use tonic::codegen::*;
602    use tonic::codegen::http::Uri;
603    #[derive(Debug, Clone)]
604    pub struct PlanServiceClient<T> {
605        inner: tonic::client::Grpc<T>,
606    }
607    impl PlanServiceClient<tonic::transport::Channel> {
608        /// Attempt to create a new client by connecting to a given endpoint.
609        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
610        where
611            D: TryInto<tonic::transport::Endpoint>,
612            D::Error: Into<StdError>,
613        {
614            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
615            Ok(Self::new(conn))
616        }
617    }
618    impl<T> PlanServiceClient<T>
619    where
620        T: tonic::client::GrpcService<tonic::body::Body>,
621        T::Error: Into<StdError>,
622        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
623        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
624    {
625        pub fn new(inner: T) -> Self {
626            let inner = tonic::client::Grpc::new(inner);
627            Self { inner }
628        }
629        pub fn with_origin(inner: T, origin: Uri) -> Self {
630            let inner = tonic::client::Grpc::with_origin(inner, origin);
631            Self { inner }
632        }
633        pub fn with_interceptor<F>(
634            inner: T,
635            interceptor: F,
636        ) -> PlanServiceClient<InterceptedService<T, F>>
637        where
638            F: tonic::service::Interceptor,
639            T::ResponseBody: Default,
640            T: tonic::codegen::Service<
641                http::Request<tonic::body::Body>,
642                Response = http::Response<
643                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
644                >,
645            >,
646            <T as tonic::codegen::Service<
647                http::Request<tonic::body::Body>,
648            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
649        {
650            PlanServiceClient::new(InterceptedService::new(inner, interceptor))
651        }
652        /// Compress requests with the given encoding.
653        ///
654        /// This requires the server to support it otherwise it might respond with an
655        /// error.
656        #[must_use]
657        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
658            self.inner = self.inner.send_compressed(encoding);
659            self
660        }
661        /// Enable decompressing responses.
662        #[must_use]
663        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
664            self.inner = self.inner.accept_compressed(encoding);
665            self
666        }
667        /// Limits the maximum size of a decoded message.
668        ///
669        /// Default: `4MB`
670        #[must_use]
671        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
672            self.inner = self.inner.max_decoding_message_size(limit);
673            self
674        }
675        /// Limits the maximum size of an encoded message.
676        ///
677        /// Default: `usize::MAX`
678        #[must_use]
679        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
680            self.inner = self.inner.max_encoding_message_size(limit);
681            self
682        }
683        pub async fn create_plan(
684            &mut self,
685            request: impl tonic::IntoRequest<super::CreatePlanRequest>,
686        ) -> std::result::Result<
687            tonic::Response<super::CreatePlanResponse>,
688            tonic::Status,
689        > {
690            self.inner
691                .ready()
692                .await
693                .map_err(|e| {
694                    tonic::Status::unknown(
695                        format!("Service was not ready: {}", e.into()),
696                    )
697                })?;
698            let codec = tonic::codec::ProstCodec::default();
699            let path = http::uri::PathAndQuery::from_static(
700                "/nominal.plan.v1.PlanService/CreatePlan",
701            );
702            let mut req = request.into_request();
703            req.extensions_mut()
704                .insert(GrpcMethod::new("nominal.plan.v1.PlanService", "CreatePlan"));
705            self.inner.unary(req, path, codec).await
706        }
707        pub async fn get_plan(
708            &mut self,
709            request: impl tonic::IntoRequest<super::GetPlanRequest>,
710        ) -> std::result::Result<
711            tonic::Response<super::GetPlanResponse>,
712            tonic::Status,
713        > {
714            self.inner
715                .ready()
716                .await
717                .map_err(|e| {
718                    tonic::Status::unknown(
719                        format!("Service was not ready: {}", e.into()),
720                    )
721                })?;
722            let codec = tonic::codec::ProstCodec::default();
723            let path = http::uri::PathAndQuery::from_static(
724                "/nominal.plan.v1.PlanService/GetPlan",
725            );
726            let mut req = request.into_request();
727            req.extensions_mut()
728                .insert(GrpcMethod::new("nominal.plan.v1.PlanService", "GetPlan"));
729            self.inner.unary(req, path, codec).await
730        }
731        pub async fn batch_get_plans(
732            &mut self,
733            request: impl tonic::IntoRequest<super::BatchGetPlansRequest>,
734        ) -> std::result::Result<
735            tonic::Response<super::BatchGetPlansResponse>,
736            tonic::Status,
737        > {
738            self.inner
739                .ready()
740                .await
741                .map_err(|e| {
742                    tonic::Status::unknown(
743                        format!("Service was not ready: {}", e.into()),
744                    )
745                })?;
746            let codec = tonic::codec::ProstCodec::default();
747            let path = http::uri::PathAndQuery::from_static(
748                "/nominal.plan.v1.PlanService/BatchGetPlans",
749            );
750            let mut req = request.into_request();
751            req.extensions_mut()
752                .insert(GrpcMethod::new("nominal.plan.v1.PlanService", "BatchGetPlans"));
753            self.inner.unary(req, path, codec).await
754        }
755        pub async fn create_plan_commit(
756            &mut self,
757            request: impl tonic::IntoRequest<super::CreatePlanCommitRequest>,
758        ) -> std::result::Result<
759            tonic::Response<super::CreatePlanCommitResponse>,
760            tonic::Status,
761        > {
762            self.inner
763                .ready()
764                .await
765                .map_err(|e| {
766                    tonic::Status::unknown(
767                        format!("Service was not ready: {}", e.into()),
768                    )
769                })?;
770            let codec = tonic::codec::ProstCodec::default();
771            let path = http::uri::PathAndQuery::from_static(
772                "/nominal.plan.v1.PlanService/CreatePlanCommit",
773            );
774            let mut req = request.into_request();
775            req.extensions_mut()
776                .insert(
777                    GrpcMethod::new("nominal.plan.v1.PlanService", "CreatePlanCommit"),
778                );
779            self.inner.unary(req, path, codec).await
780        }
781        pub async fn update_plan_metadata(
782            &mut self,
783            request: impl tonic::IntoRequest<super::UpdatePlanMetadataRequest>,
784        ) -> std::result::Result<
785            tonic::Response<super::UpdatePlanMetadataResponse>,
786            tonic::Status,
787        > {
788            self.inner
789                .ready()
790                .await
791                .map_err(|e| {
792                    tonic::Status::unknown(
793                        format!("Service was not ready: {}", e.into()),
794                    )
795                })?;
796            let codec = tonic::codec::ProstCodec::default();
797            let path = http::uri::PathAndQuery::from_static(
798                "/nominal.plan.v1.PlanService/UpdatePlanMetadata",
799            );
800            let mut req = request.into_request();
801            req.extensions_mut()
802                .insert(
803                    GrpcMethod::new("nominal.plan.v1.PlanService", "UpdatePlanMetadata"),
804                );
805            self.inner.unary(req, path, codec).await
806        }
807        pub async fn search_plans(
808            &mut self,
809            request: impl tonic::IntoRequest<super::SearchPlansRequest>,
810        ) -> std::result::Result<
811            tonic::Response<super::SearchPlansResponse>,
812            tonic::Status,
813        > {
814            self.inner
815                .ready()
816                .await
817                .map_err(|e| {
818                    tonic::Status::unknown(
819                        format!("Service was not ready: {}", e.into()),
820                    )
821                })?;
822            let codec = tonic::codec::ProstCodec::default();
823            let path = http::uri::PathAndQuery::from_static(
824                "/nominal.plan.v1.PlanService/SearchPlans",
825            );
826            let mut req = request.into_request();
827            req.extensions_mut()
828                .insert(GrpcMethod::new("nominal.plan.v1.PlanService", "SearchPlans"));
829            self.inner.unary(req, path, codec).await
830        }
831    }
832}