#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Plan {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub metadata: ::core::option::Option<PlanMetadata>,
#[prost(message, optional, tag = "3")]
pub commit: ::core::option::Option<super::super::versioning::v1::Commit>,
#[prost(message, optional, tag = "4")]
pub content: ::core::option::Option<PlanContent>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanSummary {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub metadata: ::core::option::Option<PlanMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanMetadata {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "4")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "5")]
pub is_archived: bool,
#[prost(bool, optional, tag = "6")]
pub is_published: ::core::option::Option<bool>,
#[prost(string, tag = "7")]
pub created_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "9")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "10")]
pub edited_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "11")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub updated_by: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanContent {
#[prost(oneof = "plan_content::PlanContent", tags = "1")]
pub plan_content: ::core::option::Option<plan_content::PlanContent>,
}
pub mod plan_content {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PlanContent {
#[prost(message, tag = "1")]
V1(super::PlanContentV1),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanContentV1 {
#[prost(message, optional, tag = "1")]
pub start_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "2")]
pub end_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, repeated, tag = "3")]
pub objectives: ::prost::alloc::vec::Vec<Objective>,
#[prost(message, repeated, tag = "4")]
pub events: ::prost::alloc::vec::Vec<Event>,
#[prost(message, repeated, tag = "5")]
pub segments: ::prost::alloc::vec::Vec<Segment>,
#[prost(message, repeated, tag = "6")]
pub asset_groups: ::prost::alloc::vec::Vec<AssetGroup>,
#[prost(message, repeated, tag = "7")]
pub milestones: ::prost::alloc::vec::Vec<Milestone>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Milestone {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub details: ::core::option::Option<EventDetails>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventDetails {
#[prost(oneof = "event_details::EventDetails", tags = "1")]
pub event_details: ::core::option::Option<event_details::EventDetails>,
}
pub mod event_details {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum EventDetails {
#[prost(message, tag = "1")]
Single(super::SingleEvent),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SingleEvent {
#[prost(message, optional, tag = "1")]
pub start_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "2")]
pub end_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, optional, tag = "3")]
pub segment_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub objective_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub status: ::core::option::Option<EventStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventStatus {
#[prost(oneof = "event_status::EventStatus", tags = "1, 2, 3, 4, 5")]
pub event_status: ::core::option::Option<event_status::EventStatus>,
}
pub mod event_status {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum EventStatus {
#[prost(message, tag = "1")]
Created(super::CreatedEvent),
#[prost(message, tag = "2")]
Finalized(super::FinalizedEvent),
#[prost(message, tag = "3")]
InProgress(super::InProgressEvent),
#[prost(message, tag = "4")]
Completed(super::CompletedEvent),
#[prost(message, tag = "5")]
Cancelled(super::CancelledEvent),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreatedEvent {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FinalizedEvent {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InProgressEvent {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletedEvent {
#[prost(string, optional, tag = "1")]
pub notes: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelledEvent {
#[prost(string, tag = "1")]
pub reason: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub notes: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Objective {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub creator: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(enumeration = "super::super::types::Priority", tag = "5")]
pub priority: i32,
#[prost(string, repeated, tag = "6")]
pub milestone_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "7")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "8")]
pub details: ::core::option::Option<ObjectiveDetails>,
#[prost(message, optional, tag = "9")]
pub status: ::core::option::Option<ObjectiveStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectiveStatus {
#[prost(oneof = "objective_status::ObjectiveStatus", tags = "1, 2, 3, 4, 5")]
pub objective_status: ::core::option::Option<objective_status::ObjectiveStatus>,
}
pub mod objective_status {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ObjectiveStatus {
#[prost(message, tag = "1")]
Draft(super::DraftObjective),
#[prost(message, tag = "2")]
Proposed(super::ProposedObjective),
#[prost(message, tag = "3")]
Finalized(super::FinalizedObjective),
#[prost(message, tag = "4")]
Completed(super::CompletedObjective),
#[prost(message, tag = "5")]
Rejected(super::RejectedObjective),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DraftObjective {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProposedObjective {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FinalizedObjective {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletedObjective {
#[prost(message, optional, tag = "1")]
pub disposition: ::core::option::Option<ObjectiveDisposition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RejectedObjective {
#[prost(string, tag = "1")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectiveDisposition {
#[prost(oneof = "objective_disposition::ObjectiveDisposition", tags = "1, 2")]
pub objective_disposition: ::core::option::Option<
objective_disposition::ObjectiveDisposition,
>,
}
pub mod objective_disposition {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ObjectiveDisposition {
#[prost(message, tag = "1")]
Successful(super::SuccessfulObjective),
#[prost(message, tag = "2")]
Failed(super::FailedObjective),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuccessfulObjective {
#[prost(string, optional, tag = "1")]
pub notes: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FailedObjective {
#[prost(string, tag = "1")]
pub reason: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub notes: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectiveDetails {
#[prost(oneof = "objective_details::ObjectiveDetails", tags = "1")]
pub objective_details: ::core::option::Option<objective_details::ObjectiveDetails>,
}
pub mod objective_details {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ObjectiveDetails {
#[prost(message, tag = "1")]
Simple(super::SimpleObjective),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimpleObjective {
#[prost(message, repeated, tag = "1")]
pub resources: ::prost::alloc::vec::Vec<Resource>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Resource {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "3")]
pub count: ::core::option::Option<i32>,
#[prost(message, optional, tag = "4")]
pub candidate_assets: ::core::option::Option<CandidateAssetGroup>,
#[prost(string, repeated, tag = "5")]
pub finalized_asset_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandidateAssetGroup {
#[prost(oneof = "candidate_asset_group::CandidateAssetGroup", tags = "1, 2")]
pub candidate_asset_group: ::core::option::Option<
candidate_asset_group::CandidateAssetGroup,
>,
}
pub mod candidate_asset_group {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CandidateAssetGroup {
#[prost(message, tag = "1")]
Sources(super::AssetSourceList),
#[prost(string, tag = "2")]
AssetGroupId(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetSourceList {
#[prost(message, repeated, tag = "1")]
pub sources: ::prost::alloc::vec::Vec<AssetSource>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetGroup {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "4")]
pub sources: ::prost::alloc::vec::Vec<AssetSource>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetSource {
#[prost(oneof = "asset_source::AssetSource", tags = "1, 2")]
pub asset_source: ::core::option::Option<asset_source::AssetSource>,
}
pub mod asset_source {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AssetSource {
#[prost(message, tag = "1")]
AssetSearch(super::super::super::asset::v2::SearchAssetsQuery),
#[prost(string, tag = "2")]
AssetRid(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segment {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub start_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub end_date: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "5")]
pub status: ::core::option::Option<SegmentStatus>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SegmentStatus {
#[prost(oneof = "segment_status::SegmentStatus", tags = "1, 2")]
pub segment_status: ::core::option::Option<segment_status::SegmentStatus>,
}
pub mod segment_status {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum SegmentStatus {
#[prost(message, tag = "1")]
Draft(super::DraftSegment),
#[prost(message, tag = "2")]
Finalized(super::FinalizedSegment),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DraftSegment {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FinalizedSegment {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePlanRequest {
#[prost(message, optional, tag = "1")]
pub plan: ::core::option::Option<Plan>,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePlanResponse {
#[prost(message, optional, tag = "1")]
pub plan: ::core::option::Option<Plan>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPlanRequest {
#[prost(string, tag = "1")]
pub plan_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub at: ::core::option::Option<super::super::versioning::v1::BranchOrCommit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPlanResponse {
#[prost(message, optional, tag = "1")]
pub plan: ::core::option::Option<Plan>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetPlansRequest {
#[prost(string, repeated, tag = "1")]
pub plan_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetPlansResponse {
#[prost(message, repeated, tag = "1")]
pub plans: ::prost::alloc::vec::Vec<Plan>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePlanCommitRequest {
#[prost(string, tag = "1")]
pub plan_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub content: ::core::option::Option<PlanContent>,
#[prost(string, optional, tag = "3")]
pub branch: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub message: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub is_working_state: bool,
#[prost(string, optional, tag = "6")]
pub expected_latest_commit: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePlanCommitResponse {
#[prost(message, optional, tag = "1")]
pub plan: ::core::option::Option<Plan>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePlanMetadataRequest {
#[prost(string, tag = "1")]
pub plan_rid: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub title: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub labels: ::core::option::Option<super::super::types::LabelUpdateWrapper>,
#[prost(message, optional, tag = "5")]
pub properties: ::core::option::Option<super::super::types::PropertyUpdateWrapper>,
#[prost(bool, optional, tag = "6")]
pub is_archived: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "7")]
pub is_published: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePlanMetadataResponse {
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<PlanMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPlansQuery {
#[prost(
oneof = "search_plans_query::Query",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13"
)]
pub query: ::core::option::Option<search_plans_query::Query>,
}
pub mod search_plans_query {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
#[prost(message, tag = "1")]
And(super::SearchPlansQueryList),
#[prost(message, tag = "2")]
Or(super::SearchPlansQueryList),
#[prost(message, tag = "3")]
Not(::prost::alloc::boxed::Box<super::SearchPlansQuery>),
#[prost(string, tag = "4")]
ExactMatch(::prost::alloc::string::String),
#[prost(string, tag = "5")]
SearchText(::prost::alloc::string::String),
#[prost(message, tag = "6")]
Labels(super::super::super::types::LabelsFilter),
#[prost(message, tag = "7")]
Properties(super::super::super::types::PropertiesFilter),
#[prost(string, tag = "8")]
CreatedBy(::prost::alloc::string::String),
#[prost(bool, tag = "9")]
IsArchived(bool),
#[prost(bool, tag = "10")]
IsPublished(bool),
#[prost(bool, tag = "11")]
AuthorIsCurrentUser(bool),
#[prost(message, tag = "12")]
AuthorRids(super::UserRidList),
#[prost(string, tag = "13")]
WorkspaceRid(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPlansQueryList {
#[prost(message, repeated, tag = "1")]
pub queries: ::prost::alloc::vec::Vec<SearchPlansQuery>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserRidList {
#[prost(string, repeated, tag = "1")]
pub user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PlanSortOptions {
#[prost(enumeration = "PlanSortField", tag = "1")]
pub field: i32,
#[prost(bool, tag = "2")]
pub is_descending: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPlansRequest {
#[prost(message, optional, tag = "1")]
pub query: ::core::option::Option<SearchPlansQuery>,
#[prost(message, optional, tag = "2")]
pub sort: ::core::option::Option<PlanSortOptions>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "4")]
pub page_size: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPlansResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<PlanSummary>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PlanSortField {
Unspecified = 0,
Name = 1,
CreatedAt = 2,
EditedAt = 3,
}
impl PlanSortField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PLAN_SORT_FIELD_UNSPECIFIED",
Self::Name => "NAME",
Self::CreatedAt => "CREATED_AT",
Self::EditedAt => "EDITED_AT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PLAN_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"NAME" => Some(Self::Name),
"CREATED_AT" => Some(Self::CreatedAt),
"EDITED_AT" => Some(Self::EditedAt),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PlanError {
PlanNotFound = 0,
BranchOrCommitNotFound = 1,
CommitConflict = 2,
PlanArchived = 3,
}
impl PlanError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::PlanNotFound => "PLAN_ERROR_PLAN_NOT_FOUND",
Self::BranchOrCommitNotFound => "PLAN_ERROR_BRANCH_OR_COMMIT_NOT_FOUND",
Self::CommitConflict => "PLAN_ERROR_COMMIT_CONFLICT",
Self::PlanArchived => "PLAN_ERROR_PLAN_ARCHIVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PLAN_ERROR_PLAN_NOT_FOUND" => Some(Self::PlanNotFound),
"PLAN_ERROR_BRANCH_OR_COMMIT_NOT_FOUND" => Some(Self::BranchOrCommitNotFound),
"PLAN_ERROR_COMMIT_CONFLICT" => Some(Self::CommitConflict),
"PLAN_ERROR_PLAN_ARCHIVED" => Some(Self::PlanArchived),
_ => None,
}
}
}
pub mod plan_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct PlanServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PlanServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PlanServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PlanServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
PlanServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_plan(
&mut self,
request: impl tonic::IntoRequest<super::CreatePlanRequest>,
) -> std::result::Result<
tonic::Response<super::CreatePlanResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/CreatePlan",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.plan.v1.PlanService", "CreatePlan"));
self.inner.unary(req, path, codec).await
}
pub async fn get_plan(
&mut self,
request: impl tonic::IntoRequest<super::GetPlanRequest>,
) -> std::result::Result<
tonic::Response<super::GetPlanResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/GetPlan",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.plan.v1.PlanService", "GetPlan"));
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_plans(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetPlansRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetPlansResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/BatchGetPlans",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.plan.v1.PlanService", "BatchGetPlans"));
self.inner.unary(req, path, codec).await
}
pub async fn create_plan_commit(
&mut self,
request: impl tonic::IntoRequest<super::CreatePlanCommitRequest>,
) -> std::result::Result<
tonic::Response<super::CreatePlanCommitResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/CreatePlanCommit",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.plan.v1.PlanService", "CreatePlanCommit"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_plan_metadata(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePlanMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::UpdatePlanMetadataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/UpdatePlanMetadata",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.plan.v1.PlanService", "UpdatePlanMetadata"),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_plans(
&mut self,
request: impl tonic::IntoRequest<super::SearchPlansRequest>,
) -> std::result::Result<
tonic::Response<super::SearchPlansResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.plan.v1.PlanService/SearchPlans",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.plan.v1.PlanService", "SearchPlans"));
self.inner.unary(req, path, codec).await
}
}
}