1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ChartTheme {
4 #[prost(string, tag = "1")]
5 pub rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub name: ::prost::alloc::string::String,
8 #[prost(string, tag = "3")]
9 pub created_by: ::prost::alloc::string::String,
10 #[prost(message, optional, tag = "4")]
11 pub created_at: ::core::option::Option<
12 super::super::super::google::protobuf::Timestamp,
13 >,
14 #[prost(string, optional, tag = "5")]
15 pub updated_by: ::core::option::Option<::prost::alloc::string::String>,
16 #[prost(message, optional, tag = "6")]
17 pub updated_at: ::core::option::Option<
18 super::super::super::google::protobuf::Timestamp,
19 >,
20 #[prost(message, optional, tag = "7")]
21 pub content: ::core::option::Option<ChartThemeContent>,
22}
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct ChartThemeContent {
25 #[prost(oneof = "chart_theme_content::ChartThemeContent", tags = "1")]
26 pub chart_theme_content: ::core::option::Option<
27 chart_theme_content::ChartThemeContent,
28 >,
29}
30pub mod chart_theme_content {
32 #[derive(Clone, PartialEq, ::prost::Oneof)]
33 pub enum ChartThemeContent {
34 #[prost(message, tag = "1")]
35 V1(super::ChartThemeContentV1),
36 }
37}
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct ChartThemeContentV1 {
40 #[prost(bool, tag = "1")]
41 pub title_enabled: bool,
42 #[prost(enumeration = "TextAlignment", tag = "2")]
43 pub title_alignment: i32,
44 #[prost(int32, tag = "3")]
45 pub title_font_size: i32,
46 #[prost(string, tag = "4")]
47 pub title_font_color: ::prost::alloc::string::String,
48 #[prost(bool, tag = "5")]
49 pub caption_enabled: bool,
50 #[prost(enumeration = "TextAlignment", tag = "6")]
51 pub caption_alignment: i32,
52 #[prost(int32, tag = "7")]
53 pub caption_font_size: i32,
54 #[prost(string, tag = "8")]
55 pub caption_font_color: ::prost::alloc::string::String,
56 #[prost(bool, tag = "9")]
57 pub background_enabled: bool,
58 #[prost(bool, tag = "10")]
59 pub legend_enabled: bool,
60 #[prost(enumeration = "LegendPosition", tag = "11")]
61 pub legend_position: i32,
62 #[prost(int32, tag = "12")]
63 pub legend_font_size: i32,
64 #[prost(string, tag = "13")]
65 pub legend_font_color: ::prost::alloc::string::String,
66 #[prost(enumeration = "LegendPlacement", tag = "14")]
67 pub legend_placement: i32,
68 #[prost(bool, tag = "15")]
69 pub row_gap_enabled: bool,
70 #[prost(int32, optional, tag = "16")]
71 pub row_gap_size: ::core::option::Option<i32>,
72 #[prost(int32, tag = "17")]
73 pub aspect_ratio_width: i32,
74 #[prost(int32, tag = "18")]
75 pub aspect_ratio_height: i32,
76 #[prost(message, optional, tag = "19")]
77 pub chart_type_themes: ::core::option::Option<ChartTypeThemes>,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct ChartTypeThemes {
81 #[prost(message, optional, tag = "1")]
82 pub time_series: ::core::option::Option<TimeSeriesChartTheme>,
83}
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct CreateChartThemeRequest {
86 #[prost(string, tag = "1")]
87 pub name: ::prost::alloc::string::String,
88 #[prost(message, optional, tag = "2")]
89 pub content: ::core::option::Option<ChartThemeContent>,
90 #[prost(string, optional, tag = "3")]
91 pub workspace: ::core::option::Option<::prost::alloc::string::String>,
92}
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct TimeSeriesChartTheme {
95 #[prost(oneof = "time_series_chart_theme::TimeSeriesChartTheme", tags = "1")]
96 pub time_series_chart_theme: ::core::option::Option<
97 time_series_chart_theme::TimeSeriesChartTheme,
98 >,
99}
100pub mod time_series_chart_theme {
102 #[derive(Clone, PartialEq, ::prost::Oneof)]
103 pub enum TimeSeriesChartTheme {
104 #[prost(message, tag = "1")]
105 V1(super::TimeSeriesChartThemeV1),
106 }
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct TimeSeriesChartThemeV1 {
110 #[prost(int32, tag = "1")]
111 pub x_axis_tick_font_size: i32,
112 #[prost(string, tag = "2")]
113 pub x_axis_tick_font_color: ::prost::alloc::string::String,
114 #[prost(int32, tag = "3")]
115 pub y_axis_title_font_size: i32,
116 #[prost(int32, tag = "4")]
117 pub y_axis_tick_font_size: i32,
118 #[prost(int32, optional, tag = "5")]
119 pub threshold_line_width: ::core::option::Option<i32>,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct UpdateChartThemeRequest {
123 #[prost(string, tag = "1")]
124 pub name: ::prost::alloc::string::String,
125 #[prost(message, optional, tag = "2")]
126 pub content: ::core::option::Option<ChartThemeContent>,
127}
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct ListChartThemesRequest {
130 #[prost(string, repeated, tag = "1")]
131 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct ListChartThemesResponse {
135 #[prost(message, repeated, tag = "1")]
136 pub chart_themes: ::prost::alloc::vec::Vec<ChartTheme>,
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct GetChartThemeRequest {
140 #[prost(string, tag = "1")]
141 pub chart_theme_rid: ::prost::alloc::string::String,
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct GetChartThemeResponse {
145 #[prost(message, optional, tag = "1")]
146 pub chart_theme: ::core::option::Option<ChartTheme>,
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct CreateChartThemeResponse {
150 #[prost(message, optional, tag = "1")]
151 pub chart_theme: ::core::option::Option<ChartTheme>,
152}
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct UpdateChartThemeRequestWrapper {
155 #[prost(string, tag = "1")]
156 pub chart_theme_rid: ::prost::alloc::string::String,
157 #[prost(message, optional, tag = "2")]
158 pub request: ::core::option::Option<UpdateChartThemeRequest>,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct UpdateChartThemeResponse {
162 #[prost(message, optional, tag = "1")]
163 pub chart_theme: ::core::option::Option<ChartTheme>,
164}
165#[derive(Clone, PartialEq, ::prost::Message)]
166pub struct DeleteChartThemeRequest {
167 #[prost(string, tag = "1")]
168 pub chart_theme_rid: ::prost::alloc::string::String,
169}
170#[derive(Clone, Copy, PartialEq, ::prost::Message)]
171pub struct DeleteChartThemeResponse {}
172#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
173#[repr(i32)]
174pub enum LegendPlacement {
175 Unspecified = 0,
176 Outside = 1,
177 Inside = 2,
178}
179impl LegendPlacement {
180 pub fn as_str_name(&self) -> &'static str {
185 match self {
186 Self::Unspecified => "LEGEND_PLACEMENT_UNSPECIFIED",
187 Self::Outside => "OUTSIDE",
188 Self::Inside => "INSIDE",
189 }
190 }
191 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
193 match value {
194 "LEGEND_PLACEMENT_UNSPECIFIED" => Some(Self::Unspecified),
195 "OUTSIDE" => Some(Self::Outside),
196 "INSIDE" => Some(Self::Inside),
197 _ => None,
198 }
199 }
200}
201#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
202#[repr(i32)]
203pub enum LegendPosition {
204 Unspecified = 0,
205 Top = 1,
206 Bottom = 2,
207 Left = 3,
208 Right = 4,
209}
210impl LegendPosition {
211 pub fn as_str_name(&self) -> &'static str {
216 match self {
217 Self::Unspecified => "LEGEND_POSITION_UNSPECIFIED",
218 Self::Top => "TOP",
219 Self::Bottom => "BOTTOM",
220 Self::Left => "LEFT",
221 Self::Right => "RIGHT",
222 }
223 }
224 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
226 match value {
227 "LEGEND_POSITION_UNSPECIFIED" => Some(Self::Unspecified),
228 "TOP" => Some(Self::Top),
229 "BOTTOM" => Some(Self::Bottom),
230 "LEFT" => Some(Self::Left),
231 "RIGHT" => Some(Self::Right),
232 _ => None,
233 }
234 }
235}
236#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
237#[repr(i32)]
238pub enum TextAlignment {
239 Unspecified = 0,
240 Start = 1,
241 End = 2,
242 Center = 3,
243 Justify = 4,
244}
245impl TextAlignment {
246 pub fn as_str_name(&self) -> &'static str {
251 match self {
252 Self::Unspecified => "TEXT_ALIGNMENT_UNSPECIFIED",
253 Self::Start => "START",
254 Self::End => "END",
255 Self::Center => "CENTER",
256 Self::Justify => "JUSTIFY",
257 }
258 }
259 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
261 match value {
262 "TEXT_ALIGNMENT_UNSPECIFIED" => Some(Self::Unspecified),
263 "START" => Some(Self::Start),
264 "END" => Some(Self::End),
265 "CENTER" => Some(Self::Center),
266 "JUSTIFY" => Some(Self::Justify),
267 _ => None,
268 }
269 }
270}
271#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
272#[repr(i32)]
273pub enum TextDirection {
274 Unspecified = 0,
275 Horizontal = 1,
276 Vertical = 2,
277}
278impl TextDirection {
279 pub fn as_str_name(&self) -> &'static str {
284 match self {
285 Self::Unspecified => "TEXT_DIRECTION_UNSPECIFIED",
286 Self::Horizontal => "HORIZONTAL",
287 Self::Vertical => "VERTICAL",
288 }
289 }
290 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
292 match value {
293 "TEXT_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
294 "HORIZONTAL" => Some(Self::Horizontal),
295 "VERTICAL" => Some(Self::Vertical),
296 _ => None,
297 }
298 }
299}
300#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
301#[repr(i32)]
302pub enum ThemesError {
303 ChartThemeNameConflict = 0,
304 ChartThemeNotFound = 1,
305 InvalidChartTheme = 2,
306}
307impl ThemesError {
308 pub fn as_str_name(&self) -> &'static str {
313 match self {
314 Self::ChartThemeNameConflict => "THEMES_ERROR_CHART_THEME_NAME_CONFLICT",
315 Self::ChartThemeNotFound => "THEMES_ERROR_CHART_THEME_NOT_FOUND",
316 Self::InvalidChartTheme => "THEMES_ERROR_INVALID_CHART_THEME",
317 }
318 }
319 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
321 match value {
322 "THEMES_ERROR_CHART_THEME_NAME_CONFLICT" => {
323 Some(Self::ChartThemeNameConflict)
324 }
325 "THEMES_ERROR_CHART_THEME_NOT_FOUND" => Some(Self::ChartThemeNotFound),
326 "THEMES_ERROR_INVALID_CHART_THEME" => Some(Self::InvalidChartTheme),
327 _ => None,
328 }
329 }
330}
331pub mod themes_service_client {
333 #![allow(
334 unused_variables,
335 dead_code,
336 missing_docs,
337 clippy::wildcard_imports,
338 clippy::let_unit_value,
339 )]
340 use tonic::codegen::*;
341 use tonic::codegen::http::Uri;
342 #[derive(Debug, Clone)]
343 pub struct ThemesServiceClient<T> {
344 inner: tonic::client::Grpc<T>,
345 }
346 impl ThemesServiceClient<tonic::transport::Channel> {
347 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
349 where
350 D: TryInto<tonic::transport::Endpoint>,
351 D::Error: Into<StdError>,
352 {
353 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
354 Ok(Self::new(conn))
355 }
356 }
357 impl<T> ThemesServiceClient<T>
358 where
359 T: tonic::client::GrpcService<tonic::body::Body>,
360 T::Error: Into<StdError>,
361 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
362 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
363 {
364 pub fn new(inner: T) -> Self {
365 let inner = tonic::client::Grpc::new(inner);
366 Self { inner }
367 }
368 pub fn with_origin(inner: T, origin: Uri) -> Self {
369 let inner = tonic::client::Grpc::with_origin(inner, origin);
370 Self { inner }
371 }
372 pub fn with_interceptor<F>(
373 inner: T,
374 interceptor: F,
375 ) -> ThemesServiceClient<InterceptedService<T, F>>
376 where
377 F: tonic::service::Interceptor,
378 T::ResponseBody: Default,
379 T: tonic::codegen::Service<
380 http::Request<tonic::body::Body>,
381 Response = http::Response<
382 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
383 >,
384 >,
385 <T as tonic::codegen::Service<
386 http::Request<tonic::body::Body>,
387 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
388 {
389 ThemesServiceClient::new(InterceptedService::new(inner, interceptor))
390 }
391 #[must_use]
396 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
397 self.inner = self.inner.send_compressed(encoding);
398 self
399 }
400 #[must_use]
402 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
403 self.inner = self.inner.accept_compressed(encoding);
404 self
405 }
406 #[must_use]
410 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
411 self.inner = self.inner.max_decoding_message_size(limit);
412 self
413 }
414 #[must_use]
418 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
419 self.inner = self.inner.max_encoding_message_size(limit);
420 self
421 }
422 pub async fn list_chart_themes(
423 &mut self,
424 request: impl tonic::IntoRequest<super::ListChartThemesRequest>,
425 ) -> std::result::Result<
426 tonic::Response<super::ListChartThemesResponse>,
427 tonic::Status,
428 > {
429 self.inner
430 .ready()
431 .await
432 .map_err(|e| {
433 tonic::Status::unknown(
434 format!("Service was not ready: {}", e.into()),
435 )
436 })?;
437 let codec = tonic::codec::ProstCodec::default();
438 let path = http::uri::PathAndQuery::from_static(
439 "/nominal.themes.v1.ThemesService/ListChartThemes",
440 );
441 let mut req = request.into_request();
442 req.extensions_mut()
443 .insert(
444 GrpcMethod::new("nominal.themes.v1.ThemesService", "ListChartThemes"),
445 );
446 self.inner.unary(req, path, codec).await
447 }
448 pub async fn get_chart_theme(
449 &mut self,
450 request: impl tonic::IntoRequest<super::GetChartThemeRequest>,
451 ) -> std::result::Result<
452 tonic::Response<super::GetChartThemeResponse>,
453 tonic::Status,
454 > {
455 self.inner
456 .ready()
457 .await
458 .map_err(|e| {
459 tonic::Status::unknown(
460 format!("Service was not ready: {}", e.into()),
461 )
462 })?;
463 let codec = tonic::codec::ProstCodec::default();
464 let path = http::uri::PathAndQuery::from_static(
465 "/nominal.themes.v1.ThemesService/GetChartTheme",
466 );
467 let mut req = request.into_request();
468 req.extensions_mut()
469 .insert(
470 GrpcMethod::new("nominal.themes.v1.ThemesService", "GetChartTheme"),
471 );
472 self.inner.unary(req, path, codec).await
473 }
474 pub async fn create_chart_theme(
475 &mut self,
476 request: impl tonic::IntoRequest<super::CreateChartThemeRequest>,
477 ) -> std::result::Result<
478 tonic::Response<super::CreateChartThemeResponse>,
479 tonic::Status,
480 > {
481 self.inner
482 .ready()
483 .await
484 .map_err(|e| {
485 tonic::Status::unknown(
486 format!("Service was not ready: {}", e.into()),
487 )
488 })?;
489 let codec = tonic::codec::ProstCodec::default();
490 let path = http::uri::PathAndQuery::from_static(
491 "/nominal.themes.v1.ThemesService/CreateChartTheme",
492 );
493 let mut req = request.into_request();
494 req.extensions_mut()
495 .insert(
496 GrpcMethod::new(
497 "nominal.themes.v1.ThemesService",
498 "CreateChartTheme",
499 ),
500 );
501 self.inner.unary(req, path, codec).await
502 }
503 pub async fn update_chart_theme(
504 &mut self,
505 request: impl tonic::IntoRequest<super::UpdateChartThemeRequestWrapper>,
506 ) -> std::result::Result<
507 tonic::Response<super::UpdateChartThemeResponse>,
508 tonic::Status,
509 > {
510 self.inner
511 .ready()
512 .await
513 .map_err(|e| {
514 tonic::Status::unknown(
515 format!("Service was not ready: {}", e.into()),
516 )
517 })?;
518 let codec = tonic::codec::ProstCodec::default();
519 let path = http::uri::PathAndQuery::from_static(
520 "/nominal.themes.v1.ThemesService/UpdateChartTheme",
521 );
522 let mut req = request.into_request();
523 req.extensions_mut()
524 .insert(
525 GrpcMethod::new(
526 "nominal.themes.v1.ThemesService",
527 "UpdateChartTheme",
528 ),
529 );
530 self.inner.unary(req, path, codec).await
531 }
532 pub async fn delete_chart_theme(
533 &mut self,
534 request: impl tonic::IntoRequest<super::DeleteChartThemeRequest>,
535 ) -> std::result::Result<
536 tonic::Response<super::DeleteChartThemeResponse>,
537 tonic::Status,
538 > {
539 self.inner
540 .ready()
541 .await
542 .map_err(|e| {
543 tonic::Status::unknown(
544 format!("Service was not ready: {}", e.into()),
545 )
546 })?;
547 let codec = tonic::codec::ProstCodec::default();
548 let path = http::uri::PathAndQuery::from_static(
549 "/nominal.themes.v1.ThemesService/DeleteChartTheme",
550 );
551 let mut req = request.into_request();
552 req.extensions_mut()
553 .insert(
554 GrpcMethod::new(
555 "nominal.themes.v1.ThemesService",
556 "DeleteChartTheme",
557 ),
558 );
559 self.inner.unary(req, path, codec).await
560 }
561 }
562}