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 TimeSeriesChartTheme {
86 #[prost(oneof = "time_series_chart_theme::TimeSeriesChartTheme", tags = "1")]
87 pub time_series_chart_theme: ::core::option::Option<
88 time_series_chart_theme::TimeSeriesChartTheme,
89 >,
90}
91pub mod time_series_chart_theme {
93 #[derive(Clone, PartialEq, ::prost::Oneof)]
94 pub enum TimeSeriesChartTheme {
95 #[prost(message, tag = "1")]
96 V1(super::TimeSeriesChartThemeV1),
97 }
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct TimeSeriesChartThemeV1 {
101 #[prost(int32, tag = "1")]
102 pub x_axis_tick_font_size: i32,
103 #[prost(string, tag = "2")]
104 pub x_axis_tick_font_color: ::prost::alloc::string::String,
105 #[prost(int32, tag = "3")]
106 pub y_axis_title_font_size: i32,
107 #[prost(int32, tag = "4")]
108 pub y_axis_tick_font_size: i32,
109 #[prost(int32, optional, tag = "5")]
110 pub threshold_line_width: ::core::option::Option<i32>,
111}
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct ListChartThemesRequest {
114 #[prost(string, repeated, tag = "1")]
115 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct ListChartThemesResponse {
119 #[prost(message, repeated, tag = "1")]
120 pub chart_themes: ::prost::alloc::vec::Vec<ChartTheme>,
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct GetChartThemeRequest {
124 #[prost(string, tag = "1")]
125 pub chart_theme_rid: ::prost::alloc::string::String,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct GetChartThemeResponse {
129 #[prost(message, optional, tag = "1")]
130 pub chart_theme: ::core::option::Option<ChartTheme>,
131}
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct CreateChartThemeRequest {
134 #[prost(string, tag = "1")]
135 pub name: ::prost::alloc::string::String,
136 #[prost(message, optional, tag = "2")]
137 pub content: ::core::option::Option<ChartThemeContent>,
138 #[prost(string, optional, tag = "3")]
139 pub workspace: ::core::option::Option<::prost::alloc::string::String>,
140}
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct CreateChartThemeResponse {
143 #[prost(message, optional, tag = "1")]
144 pub chart_theme: ::core::option::Option<ChartTheme>,
145}
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct UpdateChartThemeRequest {
148 #[prost(string, tag = "1")]
149 pub chart_theme_rid: ::prost::alloc::string::String,
150 #[prost(string, tag = "2")]
151 pub name: ::prost::alloc::string::String,
152 #[prost(message, optional, tag = "3")]
153 pub content: ::core::option::Option<ChartThemeContent>,
154}
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct UpdateChartThemeResponse {
157 #[prost(message, optional, tag = "1")]
158 pub chart_theme: ::core::option::Option<ChartTheme>,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct DeleteChartThemeRequest {
162 #[prost(string, tag = "1")]
163 pub chart_theme_rid: ::prost::alloc::string::String,
164}
165#[derive(Clone, Copy, PartialEq, ::prost::Message)]
166pub struct DeleteChartThemeResponse {}
167#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
168#[repr(i32)]
169pub enum LegendPlacement {
170 Unspecified = 0,
171 Outside = 1,
172 Inside = 2,
173}
174impl LegendPlacement {
175 pub fn as_str_name(&self) -> &'static str {
180 match self {
181 Self::Unspecified => "LEGEND_PLACEMENT_UNSPECIFIED",
182 Self::Outside => "OUTSIDE",
183 Self::Inside => "INSIDE",
184 }
185 }
186 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
188 match value {
189 "LEGEND_PLACEMENT_UNSPECIFIED" => Some(Self::Unspecified),
190 "OUTSIDE" => Some(Self::Outside),
191 "INSIDE" => Some(Self::Inside),
192 _ => None,
193 }
194 }
195}
196#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
197#[repr(i32)]
198pub enum LegendPosition {
199 Unspecified = 0,
200 Top = 1,
201 Bottom = 2,
202 Left = 3,
203 Right = 4,
204}
205impl LegendPosition {
206 pub fn as_str_name(&self) -> &'static str {
211 match self {
212 Self::Unspecified => "LEGEND_POSITION_UNSPECIFIED",
213 Self::Top => "TOP",
214 Self::Bottom => "BOTTOM",
215 Self::Left => "LEFT",
216 Self::Right => "RIGHT",
217 }
218 }
219 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
221 match value {
222 "LEGEND_POSITION_UNSPECIFIED" => Some(Self::Unspecified),
223 "TOP" => Some(Self::Top),
224 "BOTTOM" => Some(Self::Bottom),
225 "LEFT" => Some(Self::Left),
226 "RIGHT" => Some(Self::Right),
227 _ => None,
228 }
229 }
230}
231#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
232#[repr(i32)]
233pub enum TextAlignment {
234 Unspecified = 0,
235 Start = 1,
236 End = 2,
237 Center = 3,
238 Justify = 4,
239}
240impl TextAlignment {
241 pub fn as_str_name(&self) -> &'static str {
246 match self {
247 Self::Unspecified => "TEXT_ALIGNMENT_UNSPECIFIED",
248 Self::Start => "START",
249 Self::End => "END",
250 Self::Center => "CENTER",
251 Self::Justify => "JUSTIFY",
252 }
253 }
254 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
256 match value {
257 "TEXT_ALIGNMENT_UNSPECIFIED" => Some(Self::Unspecified),
258 "START" => Some(Self::Start),
259 "END" => Some(Self::End),
260 "CENTER" => Some(Self::Center),
261 "JUSTIFY" => Some(Self::Justify),
262 _ => None,
263 }
264 }
265}
266#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
267#[repr(i32)]
268pub enum ThemesError {
269 ChartThemeNameConflict = 0,
270 ChartThemeNotFound = 1,
271 InvalidChartTheme = 2,
272}
273impl ThemesError {
274 pub fn as_str_name(&self) -> &'static str {
279 match self {
280 Self::ChartThemeNameConflict => "THEMES_ERROR_CHART_THEME_NAME_CONFLICT",
281 Self::ChartThemeNotFound => "THEMES_ERROR_CHART_THEME_NOT_FOUND",
282 Self::InvalidChartTheme => "THEMES_ERROR_INVALID_CHART_THEME",
283 }
284 }
285 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
287 match value {
288 "THEMES_ERROR_CHART_THEME_NAME_CONFLICT" => {
289 Some(Self::ChartThemeNameConflict)
290 }
291 "THEMES_ERROR_CHART_THEME_NOT_FOUND" => Some(Self::ChartThemeNotFound),
292 "THEMES_ERROR_INVALID_CHART_THEME" => Some(Self::InvalidChartTheme),
293 _ => None,
294 }
295 }
296}
297pub mod themes_service_client {
299 #![allow(
300 unused_variables,
301 dead_code,
302 missing_docs,
303 clippy::wildcard_imports,
304 clippy::let_unit_value,
305 )]
306 use tonic::codegen::*;
307 use tonic::codegen::http::Uri;
308 #[derive(Debug, Clone)]
309 pub struct ThemesServiceClient<T> {
310 inner: tonic::client::Grpc<T>,
311 }
312 impl ThemesServiceClient<tonic::transport::Channel> {
313 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
315 where
316 D: TryInto<tonic::transport::Endpoint>,
317 D::Error: Into<StdError>,
318 {
319 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
320 Ok(Self::new(conn))
321 }
322 }
323 impl<T> ThemesServiceClient<T>
324 where
325 T: tonic::client::GrpcService<tonic::body::Body>,
326 T::Error: Into<StdError>,
327 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
328 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
329 {
330 pub fn new(inner: T) -> Self {
331 let inner = tonic::client::Grpc::new(inner);
332 Self { inner }
333 }
334 pub fn with_origin(inner: T, origin: Uri) -> Self {
335 let inner = tonic::client::Grpc::with_origin(inner, origin);
336 Self { inner }
337 }
338 pub fn with_interceptor<F>(
339 inner: T,
340 interceptor: F,
341 ) -> ThemesServiceClient<InterceptedService<T, F>>
342 where
343 F: tonic::service::Interceptor,
344 T::ResponseBody: Default,
345 T: tonic::codegen::Service<
346 http::Request<tonic::body::Body>,
347 Response = http::Response<
348 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
349 >,
350 >,
351 <T as tonic::codegen::Service<
352 http::Request<tonic::body::Body>,
353 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
354 {
355 ThemesServiceClient::new(InterceptedService::new(inner, interceptor))
356 }
357 #[must_use]
362 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
363 self.inner = self.inner.send_compressed(encoding);
364 self
365 }
366 #[must_use]
368 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
369 self.inner = self.inner.accept_compressed(encoding);
370 self
371 }
372 #[must_use]
376 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
377 self.inner = self.inner.max_decoding_message_size(limit);
378 self
379 }
380 #[must_use]
384 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
385 self.inner = self.inner.max_encoding_message_size(limit);
386 self
387 }
388 pub async fn list_chart_themes(
389 &mut self,
390 request: impl tonic::IntoRequest<super::ListChartThemesRequest>,
391 ) -> std::result::Result<
392 tonic::Response<super::ListChartThemesResponse>,
393 tonic::Status,
394 > {
395 self.inner
396 .ready()
397 .await
398 .map_err(|e| {
399 tonic::Status::unknown(
400 format!("Service was not ready: {}", e.into()),
401 )
402 })?;
403 let codec = tonic::codec::ProstCodec::default();
404 let path = http::uri::PathAndQuery::from_static(
405 "/nominal.themes.v2.ThemesService/ListChartThemes",
406 );
407 let mut req = request.into_request();
408 req.extensions_mut()
409 .insert(
410 GrpcMethod::new("nominal.themes.v2.ThemesService", "ListChartThemes"),
411 );
412 self.inner.unary(req, path, codec).await
413 }
414 pub async fn get_chart_theme(
415 &mut self,
416 request: impl tonic::IntoRequest<super::GetChartThemeRequest>,
417 ) -> std::result::Result<
418 tonic::Response<super::GetChartThemeResponse>,
419 tonic::Status,
420 > {
421 self.inner
422 .ready()
423 .await
424 .map_err(|e| {
425 tonic::Status::unknown(
426 format!("Service was not ready: {}", e.into()),
427 )
428 })?;
429 let codec = tonic::codec::ProstCodec::default();
430 let path = http::uri::PathAndQuery::from_static(
431 "/nominal.themes.v2.ThemesService/GetChartTheme",
432 );
433 let mut req = request.into_request();
434 req.extensions_mut()
435 .insert(
436 GrpcMethod::new("nominal.themes.v2.ThemesService", "GetChartTheme"),
437 );
438 self.inner.unary(req, path, codec).await
439 }
440 pub async fn create_chart_theme(
441 &mut self,
442 request: impl tonic::IntoRequest<super::CreateChartThemeRequest>,
443 ) -> std::result::Result<
444 tonic::Response<super::CreateChartThemeResponse>,
445 tonic::Status,
446 > {
447 self.inner
448 .ready()
449 .await
450 .map_err(|e| {
451 tonic::Status::unknown(
452 format!("Service was not ready: {}", e.into()),
453 )
454 })?;
455 let codec = tonic::codec::ProstCodec::default();
456 let path = http::uri::PathAndQuery::from_static(
457 "/nominal.themes.v2.ThemesService/CreateChartTheme",
458 );
459 let mut req = request.into_request();
460 req.extensions_mut()
461 .insert(
462 GrpcMethod::new(
463 "nominal.themes.v2.ThemesService",
464 "CreateChartTheme",
465 ),
466 );
467 self.inner.unary(req, path, codec).await
468 }
469 pub async fn update_chart_theme(
470 &mut self,
471 request: impl tonic::IntoRequest<super::UpdateChartThemeRequest>,
472 ) -> std::result::Result<
473 tonic::Response<super::UpdateChartThemeResponse>,
474 tonic::Status,
475 > {
476 self.inner
477 .ready()
478 .await
479 .map_err(|e| {
480 tonic::Status::unknown(
481 format!("Service was not ready: {}", e.into()),
482 )
483 })?;
484 let codec = tonic::codec::ProstCodec::default();
485 let path = http::uri::PathAndQuery::from_static(
486 "/nominal.themes.v2.ThemesService/UpdateChartTheme",
487 );
488 let mut req = request.into_request();
489 req.extensions_mut()
490 .insert(
491 GrpcMethod::new(
492 "nominal.themes.v2.ThemesService",
493 "UpdateChartTheme",
494 ),
495 );
496 self.inner.unary(req, path, codec).await
497 }
498 pub async fn delete_chart_theme(
499 &mut self,
500 request: impl tonic::IntoRequest<super::DeleteChartThemeRequest>,
501 ) -> std::result::Result<
502 tonic::Response<super::DeleteChartThemeResponse>,
503 tonic::Status,
504 > {
505 self.inner
506 .ready()
507 .await
508 .map_err(|e| {
509 tonic::Status::unknown(
510 format!("Service was not ready: {}", e.into()),
511 )
512 })?;
513 let codec = tonic::codec::ProstCodec::default();
514 let path = http::uri::PathAndQuery::from_static(
515 "/nominal.themes.v2.ThemesService/DeleteChartTheme",
516 );
517 let mut req = request.into_request();
518 req.extensions_mut()
519 .insert(
520 GrpcMethod::new(
521 "nominal.themes.v2.ThemesService",
522 "DeleteChartTheme",
523 ),
524 );
525 self.inner.unary(req, path, codec).await
526 }
527 }
528}