1#![doc = r" This module contains the generated types for the library."]
2pub mod base64 {
3 #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"]
4 #![doc = " base64 implementations to account for various clients and libraries. Compatible"]
5 #![doc = " with serde and JsonSchema."]
6 use std::{convert::TryFrom, fmt};
7
8 use serde::{
9 de::{Error, Unexpected, Visitor},
10 Deserialize, Deserializer, Serialize, Serializer,
11 };
12 static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[
13 data_encoding::BASE64,
14 data_encoding::BASE64URL,
15 data_encoding::BASE64URL_NOPAD,
16 data_encoding::BASE64_MIME,
17 data_encoding::BASE64_NOPAD,
18 ];
19 #[derive(Debug, Clone, PartialEq, Eq)]
20 #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"]
21 #[doc = " when deserializing, will decode from many different types of base64 possible."]
22 pub struct Base64Data(pub Vec<u8>);
23 impl Base64Data {
24 #[doc = " Return is the data is empty."]
25 pub fn is_empty(&self) -> bool {
26 self.0.is_empty()
27 }
28 }
29
30 impl fmt::Display for Base64Data {
31 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32 write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0))
33 }
34 }
35
36 impl From<Base64Data> for Vec<u8> {
37 fn from(data: Base64Data) -> Vec<u8> {
38 data.0
39 }
40 }
41
42 impl From<Vec<u8>> for Base64Data {
43 fn from(data: Vec<u8>) -> Base64Data {
44 Base64Data(data)
45 }
46 }
47
48 impl AsRef<[u8]> for Base64Data {
49 fn as_ref(&self) -> &[u8] {
50 &self.0
51 }
52 }
53
54 impl TryFrom<&str> for Base64Data {
55 type Error = anyhow::Error;
56 fn try_from(v: &str) -> Result<Self, Self::Error> {
57 for config in ALLOWED_DECODING_FORMATS {
58 if let Ok(data) = config.decode(v.as_bytes()) {
59 return Ok(Base64Data(data));
60 }
61 }
62 anyhow::bail!("Could not decode base64 data: {}", v);
63 }
64 }
65
66 struct Base64DataVisitor;
67 impl<'de> Visitor<'de> for Base64DataVisitor {
68 type Value = Base64Data;
69 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
70 write!(formatter, "a base64 encoded string")
71 }
72
73 fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
74 where
75 E: Error,
76 {
77 for config in ALLOWED_DECODING_FORMATS {
78 if let Ok(data) = config.decode(v.as_bytes()) {
79 return Ok(Base64Data(data));
80 }
81 }
82 Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self))
83 }
84 }
85
86 impl<'de> Deserialize<'de> for Base64Data {
87 fn deserialize<D>(deserializer: D) -> Result<Self, <D as Deserializer<'de>>::Error>
88 where
89 D: Deserializer<'de>,
90 {
91 deserializer.deserialize_str(Base64DataVisitor)
92 }
93 }
94
95 impl Serialize for Base64Data {
96 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
97 where
98 S: Serializer,
99 {
100 let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0);
101 serializer.serialize_str(&encoded)
102 }
103 }
104
105 impl schemars::JsonSchema for Base64Data {
106 fn schema_name() -> String {
107 "Base64Data".to_string()
108 }
109
110 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
111 let mut obj = gen.root_schema_for::<String>().schema;
112 obj.format = Some("byte".to_string());
113 schemars::schema::Schema::Object(obj)
114 }
115
116 fn is_referenceable() -> bool {
117 false
118 }
119 }
120
121 #[cfg(test)]
122 mod tests {
123 use std::convert::TryFrom;
124
125 use super::Base64Data;
126 #[test]
127 fn test_base64_try_from() {
128 assert!(Base64Data::try_from("aGVsbG8=").is_ok());
129 assert!(Base64Data::try_from("abcdefghij").is_err());
130 }
131 }
132}
133
134#[cfg(feature = "requests")]
135pub mod multipart {
136 #![doc = " Multipart form data types."]
137 #[doc = " An attachement to a multipart form."]
138 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
139 pub struct Attachment {
140 #[doc = " The name of the field."]
141 pub name: String,
142 #[doc = " The filename of the attachment."]
143 pub filename: Option<String>,
144 #[doc = " The content type of the attachment."]
145 pub content_type: Option<String>,
146 #[doc = " The data of the attachment."]
147 pub data: Vec<u8>,
148 }
149
150 impl std::convert::TryFrom<Attachment> for reqwest::multipart::Part {
151 type Error = reqwest::Error;
152 fn try_from(attachment: Attachment) -> Result<Self, Self::Error> {
153 let mut part = reqwest::multipart::Part::bytes(attachment.data);
154 if let Some(filename) = attachment.filename {
155 part = part.file_name(filename);
156 }
157 if let Some(content_type) = attachment.content_type {
158 part = part.mime_str(&content_type)?;
159 }
160 Ok(part)
161 }
162 }
163
164 impl std::convert::TryFrom<std::path::PathBuf> for Attachment {
165 type Error = std::io::Error;
166 fn try_from(path: std::path::PathBuf) -> Result<Self, Self::Error> {
167 let filename = path
168 .file_name()
169 .ok_or_else(|| {
170 std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename")
171 })?
172 .to_str()
173 .ok_or_else(|| {
174 std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename")
175 })?
176 .to_string();
177 let content_type = mime_guess::from_path(&path).first_raw();
178 let data = std::fs::read(path)?;
179 Ok(Attachment {
180 name: "file".to_string(),
181 filename: Some(filename),
182 content_type: content_type.map(|s| s.to_string()),
183 data,
184 })
185 }
186 }
187}
188
189#[cfg(feature = "requests")]
190pub mod paginate {
191 #![doc = " Utility functions used for pagination."]
192 use anyhow::Result;
193 #[doc = " A trait for types that allow pagination."]
194 pub trait Pagination {
195 #[doc = " The item that is paginated."]
196 type Item: serde::de::DeserializeOwned;
197 #[doc = " Returns true if the response has more pages."]
198 fn has_more_pages(&self) -> bool;
199 #[doc = " Returns the next page token."]
200 fn next_page_token(&self) -> Option<String>;
201 #[doc = " Modify a request to get the next page."]
202 fn next_page(
203 &self,
204 req: reqwest::Request,
205 ) -> Result<reqwest::Request, crate::types::error::Error>;
206 #[doc = " Get the items from a page."]
207 fn items(&self) -> Vec<Self::Item>;
208 }
209}
210
211pub mod phone_number {
212 #![doc = " A library to implement phone numbers for our database and JSON serialization and \
213 deserialization."]
214 use std::str::FromStr;
215
216 use schemars::JsonSchema;
217 #[doc = " A phone number."]
218 #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)]
219 pub struct PhoneNumber(pub Option<phonenumber::PhoneNumber>);
220 impl From<phonenumber::PhoneNumber> for PhoneNumber {
221 fn from(id: phonenumber::PhoneNumber) -> PhoneNumber {
222 PhoneNumber(Some(id))
223 }
224 }
225
226 impl AsRef<Option<phonenumber::PhoneNumber>> for PhoneNumber {
227 fn as_ref(&self) -> &Option<phonenumber::PhoneNumber> {
228 &self.0
229 }
230 }
231
232 impl std::ops::Deref for PhoneNumber {
233 type Target = Option<phonenumber::PhoneNumber>;
234 fn deref(&self) -> &Self::Target {
235 &self.0
236 }
237 }
238
239 impl serde::ser::Serialize for PhoneNumber {
240 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
241 where
242 S: serde::ser::Serializer,
243 {
244 serializer.serialize_str(&self.to_string())
245 }
246 }
247
248 impl<'de> serde::de::Deserialize<'de> for PhoneNumber {
249 fn deserialize<D>(deserializer: D) -> Result<PhoneNumber, D::Error>
250 where
251 D: serde::de::Deserializer<'de>,
252 {
253 let s = String::deserialize(deserializer).unwrap_or_default();
254 PhoneNumber::from_str(&s).map_err(serde::de::Error::custom)
255 }
256 }
257
258 impl std::str::FromStr for PhoneNumber {
259 type Err = anyhow::Error;
260 fn from_str(s: &str) -> Result<Self, Self::Err> {
261 if s.trim().is_empty() {
262 return Ok(PhoneNumber(None));
263 }
264 let s = if !s.trim().starts_with('+') {
265 format!("+1{s}")
266 } else {
267 s.to_string()
268 }
269 .replace(['-', '(', ')', ' '], "");
270 Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err(
271 |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e),
272 )?)))
273 }
274 }
275
276 impl std::fmt::Display for PhoneNumber {
277 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
278 let s = if let Some(phone) = &self.0 {
279 phone
280 .format()
281 .mode(phonenumber::Mode::International)
282 .to_string()
283 } else {
284 String::new()
285 };
286 write!(f, "{}", s)
287 }
288 }
289
290 impl JsonSchema for PhoneNumber {
291 fn schema_name() -> String {
292 "PhoneNumber".to_string()
293 }
294
295 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
296 let mut obj = gen.root_schema_for::<String>().schema;
297 obj.format = Some("phone".to_string());
298 schemars::schema::Schema::Object(obj)
299 }
300
301 fn is_referenceable() -> bool {
302 false
303 }
304 }
305
306 #[cfg(test)]
307 mod test {
308 use pretty_assertions::assert_eq;
309
310 use super::PhoneNumber;
311 #[test]
312 fn test_parse_phone_number() {
313 let mut phone = "+1-555-555-5555";
314 let mut phone_parsed: PhoneNumber =
315 serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
316 let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
317 assert_eq!(phone_parsed, expected);
318 let mut expected_str = "+1 555-555-5555";
319 assert_eq!(expected_str, serde_json::json!(phone_parsed));
320 phone = "555-555-5555";
321 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
322 assert_eq!(phone_parsed, expected);
323 assert_eq!(expected_str, serde_json::json!(phone_parsed));
324 phone = "+1 555-555-5555";
325 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
326 assert_eq!(phone_parsed, expected);
327 assert_eq!(expected_str, serde_json::json!(phone_parsed));
328 phone = "5555555555";
329 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
330 assert_eq!(phone_parsed, expected);
331 assert_eq!(expected_str, serde_json::json!(phone_parsed));
332 phone = "(510) 864-1234";
333 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
334 expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap()));
335 assert_eq!(phone_parsed, expected);
336 expected_str = "+1 510-864-1234";
337 assert_eq!(expected_str, serde_json::json!(phone_parsed));
338 phone = "(510)8641234";
339 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
340 assert_eq!(phone_parsed, expected);
341 expected_str = "+1 510-864-1234";
342 assert_eq!(expected_str, serde_json::json!(phone_parsed));
343 phone = "";
344 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
345 assert_eq!(phone_parsed, PhoneNumber(None));
346 assert_eq!("", serde_json::json!(phone_parsed));
347 phone = "+49 30 1234 1234";
348 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
349 expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
350 assert_eq!(phone_parsed, expected);
351 expected_str = "+49 30 12341234";
352 assert_eq!(expected_str, serde_json::json!(phone_parsed));
353 }
354 }
355}
356
357#[cfg(feature = "requests")]
358pub mod error {
359 #![doc = " Error methods."]
360 #[doc = " Error produced by generated client methods."]
361 pub enum Error {
362 #[doc = " The request did not conform to API requirements."]
363 InvalidRequest(String),
364 #[cfg(feature = "retry")]
365 #[doc = " A server error either due to the data, or with the connection."]
366 CommunicationError(reqwest_middleware::Error),
367 #[doc = " A request error, caused when building the request."]
368 RequestError(reqwest::Error),
369 #[doc = " An expected response whose deserialization failed."]
370 SerdeError {
371 #[doc = " The error."]
372 error: format_serde_error::SerdeError,
373 #[doc = " The response status."]
374 status: reqwest::StatusCode,
375 },
376 #[doc = " An expected error response."]
377 InvalidResponsePayload {
378 #[cfg(feature = "retry")]
379 #[doc = " The error."]
380 error: reqwest_middleware::Error,
381 #[cfg(not(feature = "retry"))]
382 #[doc = " The error."]
383 error: reqwest::Error,
384 #[doc = " The full response."]
385 response: reqwest::Response,
386 },
387 #[doc = " An error from the server."]
388 Server {
389 #[doc = " The text from the body."]
390 body: String,
391 #[doc = " The response status."]
392 status: reqwest::StatusCode,
393 },
394 #[doc = " A response not listed in the API description. This may represent a"]
395 #[doc = " success or failure response; check `status().is_success()`."]
396 UnexpectedResponse(reqwest::Response),
397 }
398
399 impl Error {
400 #[doc = " Returns the status code, if the error was generated from a response."]
401 pub fn status(&self) -> Option<reqwest::StatusCode> {
402 match self {
403 Error::InvalidRequest(_) => None,
404 Error::RequestError(e) => e.status(),
405 #[cfg(feature = "retry")]
406 Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(),
407 #[cfg(feature = "retry")]
408 Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None,
409 Error::SerdeError { error: _, status } => Some(*status),
410 Error::InvalidResponsePayload { error: _, response } => Some(response.status()),
411 Error::Server { body: _, status } => Some(*status),
412 Error::UnexpectedResponse(r) => Some(r.status()),
413 }
414 }
415
416 #[doc = " Creates a new error from a response status and a serde error."]
417 pub fn from_serde_error(
418 e: format_serde_error::SerdeError,
419 status: reqwest::StatusCode,
420 ) -> Self {
421 Self::SerdeError { error: e, status }
422 }
423 }
424
425 #[cfg(feature = "retry")]
426 impl From<reqwest_middleware::Error> for Error {
427 fn from(e: reqwest_middleware::Error) -> Self {
428 Self::CommunicationError(e)
429 }
430 }
431
432 impl From<reqwest::Error> for Error {
433 fn from(e: reqwest::Error) -> Self {
434 Self::RequestError(e)
435 }
436 }
437
438 impl From<serde_json::Error> for Error {
439 fn from(e: serde_json::Error) -> Self {
440 Self::SerdeError {
441 error: format_serde_error::SerdeError::new(String::new(), e),
442 status: reqwest::StatusCode::INTERNAL_SERVER_ERROR,
443 }
444 }
445 }
446
447 impl std::fmt::Display for Error {
448 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
449 match self {
450 Error::InvalidRequest(s) => {
451 write!(f, "Invalid Request: {}", s)
452 }
453 #[cfg(feature = "retry")]
454 Error::CommunicationError(e) => {
455 write!(f, "Communication Error: {}", e)
456 }
457 Error::RequestError(e) => {
458 write!(f, "Request Error: {}", e)
459 }
460 Error::SerdeError { error, status: _ } => {
461 write!(f, "Serde Error: {}", error)
462 }
463 Error::InvalidResponsePayload { error, response: _ } => {
464 write!(f, "Invalid Response Payload: {}", error)
465 }
466 Error::Server { body, status } => {
467 write!(f, "Server Error: {} {}", status, body)
468 }
469 Error::UnexpectedResponse(r) => {
470 write!(f, "Unexpected Response: {:?}", r)
471 }
472 }
473 }
474 }
475
476 impl std::fmt::Debug for Error {
477 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
478 std::fmt::Display::fmt(self, f)
479 }
480 }
481
482 impl std::error::Error for Error {
483 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
484 match self {
485 #[cfg(feature = "retry")]
486 Error::CommunicationError(e) => Some(e),
487 Error::SerdeError { error, status: _ } => Some(error),
488 Error::InvalidResponsePayload { error, response: _ } => Some(error),
489 _ => None,
490 }
491 }
492 }
493}
494
495#[doc = "An ENUM of employment type"]
496#[derive(
497 serde :: Serialize,
498 serde :: Deserialize,
499 PartialEq,
500 Hash,
501 Debug,
502 Clone,
503 schemars :: JsonSchema,
504 parse_display :: FromStr,
505 parse_display :: Display,
506)]
507#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
508#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
509pub enum EmploymentType {
510 #[serde(rename = "CONTRACTOR")]
511 #[display("CONTRACTOR")]
512 Contractor,
513 #[serde(rename = "SALARIED_FT")]
514 #[display("SALARIED_FT")]
515 SalariedFt,
516 #[serde(rename = "SALARIED_PT")]
517 #[display("SALARIED_PT")]
518 SalariedPt,
519 #[serde(rename = "HOURLY_FT")]
520 #[display("HOURLY_FT")]
521 HourlyFt,
522 #[serde(rename = "HOURLY_PT")]
523 #[display("HOURLY_PT")]
524 HourlyPt,
525 #[serde(rename = "TEMP")]
526 #[display("TEMP")]
527 Temp,
528}
529
530#[doc = "The employee's gender"]
531#[derive(
532 serde :: Serialize,
533 serde :: Deserialize,
534 PartialEq,
535 Hash,
536 Debug,
537 Clone,
538 schemars :: JsonSchema,
539 parse_display :: FromStr,
540 parse_display :: Display,
541)]
542#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
543#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
544pub enum Gender {
545 #[serde(rename = "MALE")]
546 #[display("MALE")]
547 Male,
548 #[serde(rename = "FEMALE")]
549 #[display("FEMALE")]
550 Female,
551}
552
553#[doc = "The employee's identified gender"]
554#[derive(
555 serde :: Serialize,
556 serde :: Deserialize,
557 PartialEq,
558 Hash,
559 Debug,
560 Clone,
561 schemars :: JsonSchema,
562 parse_display :: FromStr,
563 parse_display :: Display,
564)]
565#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
566#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
567pub enum IdentifiedGender {
568 #[serde(rename = "MALE")]
569 #[display("MALE")]
570 Male,
571 #[serde(rename = "FEMALE")]
572 #[display("FEMALE")]
573 Female,
574 #[serde(rename = "NONBINARY")]
575 #[display("NONBINARY")]
576 Nonbinary,
577}
578
579#[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \
580 individual. An offer has not been made and they have not started working at the \
581 company.\n\nHIRED: An offer has been made but they have not accepted or started \
582 yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \
583 started yet.\n\nACTIVE: The employee currently works at the company and their start date \
584 is today or in the past.\n\nTERMINATED: The employee is no longer active."]
585#[derive(
586 serde :: Serialize,
587 serde :: Deserialize,
588 PartialEq,
589 Hash,
590 Debug,
591 Clone,
592 schemars :: JsonSchema,
593 parse_display :: FromStr,
594 parse_display :: Display,
595)]
596#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
597#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
598pub enum RoleState {
599 #[serde(rename = "INIT")]
600 #[display("INIT")]
601 Init,
602 #[serde(rename = "HIRED")]
603 #[display("HIRED")]
604 Hired,
605 #[serde(rename = "ACCEPTED")]
606 #[display("ACCEPTED")]
607 Accepted,
608 #[serde(rename = "ACTIVE")]
609 #[display("ACTIVE")]
610 Active,
611 #[serde(rename = "TERMINATED")]
612 #[display("TERMINATED")]
613 Terminated,
614}
615
616#[doc = "An employee model object."]
617#[derive(
618 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
619)]
620pub struct Employee {
621 #[doc = "This is the unique role ID of the employee. A role ID exists per 1 and only 1 \
622 company."]
623 #[serde(default, skip_serializing_if = "Option::is_none")]
624 pub id: Option<String>,
625 #[doc = "This is the unique user ID of the employee. A userID can span across 1 or many \
626 companies."]
627 #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
628 pub user_id: Option<String>,
629 #[doc = "Full name of the employee"]
630 #[serde(default, skip_serializing_if = "Option::is_none")]
631 pub name: Option<String>,
632 #[serde(
633 rename = "preferredFirstName",
634 default,
635 skip_serializing_if = "Option::is_none"
636 )]
637 pub preferred_first_name: Option<String>,
638 #[serde(
639 rename = "preferredLastName",
640 default,
641 skip_serializing_if = "Option::is_none"
642 )]
643 pub preferred_last_name: Option<String>,
644 #[doc = "First name of the employee"]
645 #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")]
646 pub first_name: Option<String>,
647 #[doc = "Last name of the employee"]
648 #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")]
649 pub last_name: Option<String>,
650 #[doc = "An ENUM of employment type"]
651 #[serde(
652 rename = "employmentType",
653 default,
654 skip_serializing_if = "Option::is_none"
655 )]
656 pub employment_type: Option<EmploymentType>,
657 #[doc = "The employee's work title"]
658 #[serde(default, skip_serializing_if = "Option::is_none")]
659 pub title: Option<String>,
660 #[doc = "The employee's gender"]
661 #[serde(default, skip_serializing_if = "Option::is_none")]
662 pub gender: Option<Gender>,
663 #[doc = "The employee's identified gender"]
664 #[serde(
665 rename = "identifiedGender",
666 default,
667 skip_serializing_if = "Option::is_none"
668 )]
669 pub identified_gender: Option<IdentifiedGender>,
670 #[doc = "The employee's department name"]
671 #[serde(default, skip_serializing_if = "Option::is_none")]
672 pub department: Option<String>,
673 #[doc = "An address object as stored within Rippling."]
674 #[serde(
675 rename = "workLocation",
676 default,
677 skip_serializing_if = "Option::is_none"
678 )]
679 pub work_location: Option<Address>,
680 #[doc = "The work location nickname"]
681 #[serde(
682 rename = "worklocationNickname",
683 default,
684 skip_serializing_if = "Option::is_none"
685 )]
686 pub worklocation_nickname: Option<String>,
687 #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")]
688 pub spoke_id: Option<String>,
689 #[doc = "The employee's end date"]
690 #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
691 pub end_date: Option<String>,
692 #[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \
693 individual. An offer has not been made and they have not started working at the \
694 company.\n\nHIRED: An offer has been made but they have not accepted or started \
695 yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \
696 started yet.\n\nACTIVE: The employee currently works at the company and their start \
697 date is today or in the past.\n\nTERMINATED: The employee is no longer active."]
698 #[serde(rename = "roleState", default, skip_serializing_if = "Option::is_none")]
699 pub role_state: Option<RoleState>,
700 #[doc = "The employee's work email"]
701 #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")]
702 pub work_email: Option<String>,
703 #[doc = "The unique identifier of the employee's manager. This value can be null."]
704 #[serde(default, skip_serializing_if = "Option::is_none")]
705 pub manager: Option<String>,
706 #[doc = "custom_fields."]
707 #[serde(
708 rename = "customFields",
709 default,
710 skip_serializing_if = "Option::is_none"
711 )]
712 pub custom_fields: Option<CustomField>,
713 #[doc = "Whether the employee is an international employee or not."]
714 #[serde(
715 rename = "isInternational",
716 default,
717 skip_serializing_if = "Option::is_none"
718 )]
719 pub is_international: Option<bool>,
720 #[doc = "Whether the employee is a manger"]
721 #[serde(rename = "isManager", default, skip_serializing_if = "Option::is_none")]
722 pub is_manager: Option<bool>,
723 #[doc = "The employee's weekly work schedule"]
724 #[serde(
725 rename = "workSchedule",
726 default,
727 skip_serializing_if = "Option::is_none"
728 )]
729 pub work_schedule: Option<serde_json::Value>,
730 #[doc = "Whether the employee's job is remote"]
731 #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")]
732 pub is_remote: Option<bool>,
733 #[doc = "This indicates the sequential employee number within their company. This number \
734 continues to grow as each employee is onboarded. i.e if you are the 65th employee to \
735 join the company with 32 active employees, the employeeNumber would be 65."]
736 #[serde(
737 rename = "employeeNumber",
738 default,
739 skip_serializing_if = "Option::is_none"
740 )]
741 pub employee_number: Option<String>,
742 #[doc = "The level of the employee"]
743 #[serde(default, skip_serializing_if = "Option::is_none")]
744 pub level: Option<String>,
745 #[doc = "An array of the teams that the employee is on"]
746 #[serde(default, skip_serializing_if = "Option::is_none")]
747 pub teams: Option<Vec<serde_json::Value>>,
748 #[doc = "The photo of the employee stored in Rippling"]
749 #[serde(default, skip_serializing_if = "Option::is_none")]
750 pub photo: Option<String>,
751 #[doc = "The small photo of the employee stored in Rippling"]
752 #[serde(
753 rename = "smallPhoto",
754 default,
755 skip_serializing_if = "Option::is_none"
756 )]
757 pub small_photo: Option<String>,
758}
759
760impl std::fmt::Display for Employee {
761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
762 write!(
763 f,
764 "{}",
765 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
766 )
767 }
768}
769
770#[cfg(feature = "tabled")]
771impl tabled::Tabled for Employee {
772 const LENGTH: usize = 29;
773 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
774 vec![
775 if let Some(id) = &self.id {
776 format!("{:?}", id).into()
777 } else {
778 String::new().into()
779 },
780 if let Some(user_id) = &self.user_id {
781 format!("{:?}", user_id).into()
782 } else {
783 String::new().into()
784 },
785 if let Some(name) = &self.name {
786 format!("{:?}", name).into()
787 } else {
788 String::new().into()
789 },
790 if let Some(preferred_first_name) = &self.preferred_first_name {
791 format!("{:?}", preferred_first_name).into()
792 } else {
793 String::new().into()
794 },
795 if let Some(preferred_last_name) = &self.preferred_last_name {
796 format!("{:?}", preferred_last_name).into()
797 } else {
798 String::new().into()
799 },
800 if let Some(first_name) = &self.first_name {
801 format!("{:?}", first_name).into()
802 } else {
803 String::new().into()
804 },
805 if let Some(last_name) = &self.last_name {
806 format!("{:?}", last_name).into()
807 } else {
808 String::new().into()
809 },
810 if let Some(employment_type) = &self.employment_type {
811 format!("{:?}", employment_type).into()
812 } else {
813 String::new().into()
814 },
815 if let Some(title) = &self.title {
816 format!("{:?}", title).into()
817 } else {
818 String::new().into()
819 },
820 if let Some(gender) = &self.gender {
821 format!("{:?}", gender).into()
822 } else {
823 String::new().into()
824 },
825 if let Some(identified_gender) = &self.identified_gender {
826 format!("{:?}", identified_gender).into()
827 } else {
828 String::new().into()
829 },
830 if let Some(department) = &self.department {
831 format!("{:?}", department).into()
832 } else {
833 String::new().into()
834 },
835 if let Some(work_location) = &self.work_location {
836 format!("{:?}", work_location).into()
837 } else {
838 String::new().into()
839 },
840 if let Some(worklocation_nickname) = &self.worklocation_nickname {
841 format!("{:?}", worklocation_nickname).into()
842 } else {
843 String::new().into()
844 },
845 if let Some(spoke_id) = &self.spoke_id {
846 format!("{:?}", spoke_id).into()
847 } else {
848 String::new().into()
849 },
850 if let Some(end_date) = &self.end_date {
851 format!("{:?}", end_date).into()
852 } else {
853 String::new().into()
854 },
855 if let Some(role_state) = &self.role_state {
856 format!("{:?}", role_state).into()
857 } else {
858 String::new().into()
859 },
860 if let Some(work_email) = &self.work_email {
861 format!("{:?}", work_email).into()
862 } else {
863 String::new().into()
864 },
865 if let Some(manager) = &self.manager {
866 format!("{:?}", manager).into()
867 } else {
868 String::new().into()
869 },
870 if let Some(custom_fields) = &self.custom_fields {
871 format!("{:?}", custom_fields).into()
872 } else {
873 String::new().into()
874 },
875 if let Some(is_international) = &self.is_international {
876 format!("{:?}", is_international).into()
877 } else {
878 String::new().into()
879 },
880 if let Some(is_manager) = &self.is_manager {
881 format!("{:?}", is_manager).into()
882 } else {
883 String::new().into()
884 },
885 if let Some(work_schedule) = &self.work_schedule {
886 format!("{:?}", work_schedule).into()
887 } else {
888 String::new().into()
889 },
890 if let Some(is_remote) = &self.is_remote {
891 format!("{:?}", is_remote).into()
892 } else {
893 String::new().into()
894 },
895 if let Some(employee_number) = &self.employee_number {
896 format!("{:?}", employee_number).into()
897 } else {
898 String::new().into()
899 },
900 if let Some(level) = &self.level {
901 format!("{:?}", level).into()
902 } else {
903 String::new().into()
904 },
905 if let Some(teams) = &self.teams {
906 format!("{:?}", teams).into()
907 } else {
908 String::new().into()
909 },
910 if let Some(photo) = &self.photo {
911 format!("{:?}", photo).into()
912 } else {
913 String::new().into()
914 },
915 if let Some(small_photo) = &self.small_photo {
916 format!("{:?}", small_photo).into()
917 } else {
918 String::new().into()
919 },
920 ]
921 }
922
923 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
924 vec![
925 "id".into(),
926 "user_id".into(),
927 "name".into(),
928 "preferred_first_name".into(),
929 "preferred_last_name".into(),
930 "first_name".into(),
931 "last_name".into(),
932 "employment_type".into(),
933 "title".into(),
934 "gender".into(),
935 "identified_gender".into(),
936 "department".into(),
937 "work_location".into(),
938 "worklocation_nickname".into(),
939 "spoke_id".into(),
940 "end_date".into(),
941 "role_state".into(),
942 "work_email".into(),
943 "manager".into(),
944 "custom_fields".into(),
945 "is_international".into(),
946 "is_manager".into(),
947 "work_schedule".into(),
948 "is_remote".into(),
949 "employee_number".into(),
950 "level".into(),
951 "teams".into(),
952 "photo".into(),
953 "small_photo".into(),
954 ]
955 }
956}
957
958#[doc = "A work location object."]
959#[derive(
960 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
961)]
962pub struct WorkLocation {
963 #[serde(default, skip_serializing_if = "Option::is_none")]
964 pub id: Option<String>,
965 #[serde(default, skip_serializing_if = "Option::is_none")]
966 pub nickname: Option<String>,
967 #[doc = "An address object as stored within Rippling."]
968 #[serde(default, skip_serializing_if = "Option::is_none")]
969 pub address: Option<Address>,
970}
971
972impl std::fmt::Display for WorkLocation {
973 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
974 write!(
975 f,
976 "{}",
977 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
978 )
979 }
980}
981
982#[cfg(feature = "tabled")]
983impl tabled::Tabled for WorkLocation {
984 const LENGTH: usize = 3;
985 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
986 vec![
987 if let Some(id) = &self.id {
988 format!("{:?}", id).into()
989 } else {
990 String::new().into()
991 },
992 if let Some(nickname) = &self.nickname {
993 format!("{:?}", nickname).into()
994 } else {
995 String::new().into()
996 },
997 if let Some(address) = &self.address {
998 format!("{:?}", address).into()
999 } else {
1000 String::new().into()
1001 },
1002 ]
1003 }
1004
1005 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1006 vec!["id".into(), "nickname".into(), "address".into()]
1007 }
1008}
1009
1010#[derive(
1011 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1012)]
1013pub struct SteLocationCode {
1014 #[serde(
1015 rename = "locationCode",
1016 default,
1017 skip_serializing_if = "Option::is_none"
1018 )]
1019 pub location_code: Option<String>,
1020 #[serde(rename = "stateCode", default, skip_serializing_if = "Option::is_none")]
1021 pub state_code: Option<String>,
1022 #[serde(
1023 rename = "countyCode",
1024 default,
1025 skip_serializing_if = "Option::is_none"
1026 )]
1027 pub county_code: Option<String>,
1028 #[serde(rename = "cityCode", default, skip_serializing_if = "Option::is_none")]
1029 pub city_code: Option<String>,
1030 #[serde(
1031 rename = "schoolCode",
1032 default,
1033 skip_serializing_if = "Option::is_none"
1034 )]
1035 pub school_code: Option<String>,
1036 #[serde(
1037 rename = "municipalityCode",
1038 default,
1039 skip_serializing_if = "Option::is_none"
1040 )]
1041 pub municipality_code: Option<String>,
1042 #[serde(rename = "psdCode", default, skip_serializing_if = "Option::is_none")]
1043 pub psd_code: Option<String>,
1044 #[serde(
1045 rename = "transitDistrictCode",
1046 default,
1047 skip_serializing_if = "Option::is_none"
1048 )]
1049 pub transit_district_code: Option<String>,
1050 #[serde(
1051 rename = "isOverridden",
1052 default,
1053 skip_serializing_if = "Option::is_none"
1054 )]
1055 pub is_overridden: Option<String>,
1056}
1057
1058impl std::fmt::Display for SteLocationCode {
1059 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1060 write!(
1061 f,
1062 "{}",
1063 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1064 )
1065 }
1066}
1067
1068#[cfg(feature = "tabled")]
1069impl tabled::Tabled for SteLocationCode {
1070 const LENGTH: usize = 9;
1071 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1072 vec![
1073 if let Some(location_code) = &self.location_code {
1074 format!("{:?}", location_code).into()
1075 } else {
1076 String::new().into()
1077 },
1078 if let Some(state_code) = &self.state_code {
1079 format!("{:?}", state_code).into()
1080 } else {
1081 String::new().into()
1082 },
1083 if let Some(county_code) = &self.county_code {
1084 format!("{:?}", county_code).into()
1085 } else {
1086 String::new().into()
1087 },
1088 if let Some(city_code) = &self.city_code {
1089 format!("{:?}", city_code).into()
1090 } else {
1091 String::new().into()
1092 },
1093 if let Some(school_code) = &self.school_code {
1094 format!("{:?}", school_code).into()
1095 } else {
1096 String::new().into()
1097 },
1098 if let Some(municipality_code) = &self.municipality_code {
1099 format!("{:?}", municipality_code).into()
1100 } else {
1101 String::new().into()
1102 },
1103 if let Some(psd_code) = &self.psd_code {
1104 format!("{:?}", psd_code).into()
1105 } else {
1106 String::new().into()
1107 },
1108 if let Some(transit_district_code) = &self.transit_district_code {
1109 format!("{:?}", transit_district_code).into()
1110 } else {
1111 String::new().into()
1112 },
1113 if let Some(is_overridden) = &self.is_overridden {
1114 format!("{:?}", is_overridden).into()
1115 } else {
1116 String::new().into()
1117 },
1118 ]
1119 }
1120
1121 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1122 vec![
1123 "location_code".into(),
1124 "state_code".into(),
1125 "county_code".into(),
1126 "city_code".into(),
1127 "school_code".into(),
1128 "municipality_code".into(),
1129 "psd_code".into(),
1130 "transit_district_code".into(),
1131 "is_overridden".into(),
1132 ]
1133 }
1134}
1135
1136#[doc = "An address object as stored within Rippling."]
1137#[derive(
1138 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1139)]
1140pub struct Address {
1141 #[serde(
1142 rename = "streetLine1",
1143 default,
1144 skip_serializing_if = "Option::is_none"
1145 )]
1146 pub street_line_1: Option<String>,
1147 #[serde(
1148 rename = "streetLine2",
1149 default,
1150 skip_serializing_if = "Option::is_none"
1151 )]
1152 pub street_line_2: Option<String>,
1153 #[serde(default, skip_serializing_if = "Option::is_none")]
1154 pub zip: Option<String>,
1155 #[serde(default, skip_serializing_if = "Option::is_none")]
1156 pub city: Option<String>,
1157 #[serde(default, skip_serializing_if = "Option::is_none")]
1158 pub state: Option<String>,
1159 #[serde(default, skip_serializing_if = "Option::is_none")]
1160 pub country: Option<String>,
1161 #[serde(default, skip_serializing_if = "Option::is_none")]
1162 pub phone: Option<String>,
1163 #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")]
1164 pub is_remote: Option<bool>,
1165 #[serde(
1166 rename = "steLocationCode",
1167 default,
1168 skip_serializing_if = "Option::is_none"
1169 )]
1170 pub ste_location_code: Option<SteLocationCode>,
1171}
1172
1173impl std::fmt::Display for Address {
1174 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1175 write!(
1176 f,
1177 "{}",
1178 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1179 )
1180 }
1181}
1182
1183#[cfg(feature = "tabled")]
1184impl tabled::Tabled for Address {
1185 const LENGTH: usize = 9;
1186 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1187 vec![
1188 if let Some(street_line_1) = &self.street_line_1 {
1189 format!("{:?}", street_line_1).into()
1190 } else {
1191 String::new().into()
1192 },
1193 if let Some(street_line_2) = &self.street_line_2 {
1194 format!("{:?}", street_line_2).into()
1195 } else {
1196 String::new().into()
1197 },
1198 if let Some(zip) = &self.zip {
1199 format!("{:?}", zip).into()
1200 } else {
1201 String::new().into()
1202 },
1203 if let Some(city) = &self.city {
1204 format!("{:?}", city).into()
1205 } else {
1206 String::new().into()
1207 },
1208 if let Some(state) = &self.state {
1209 format!("{:?}", state).into()
1210 } else {
1211 String::new().into()
1212 },
1213 if let Some(country) = &self.country {
1214 format!("{:?}", country).into()
1215 } else {
1216 String::new().into()
1217 },
1218 if let Some(phone) = &self.phone {
1219 format!("{:?}", phone).into()
1220 } else {
1221 String::new().into()
1222 },
1223 if let Some(is_remote) = &self.is_remote {
1224 format!("{:?}", is_remote).into()
1225 } else {
1226 String::new().into()
1227 },
1228 if let Some(ste_location_code) = &self.ste_location_code {
1229 format!("{:?}", ste_location_code).into()
1230 } else {
1231 String::new().into()
1232 },
1233 ]
1234 }
1235
1236 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1237 vec![
1238 "street_line_1".into(),
1239 "street_line_2".into(),
1240 "zip".into(),
1241 "city".into(),
1242 "state".into(),
1243 "country".into(),
1244 "phone".into(),
1245 "is_remote".into(),
1246 "ste_location_code".into(),
1247 ]
1248 }
1249}
1250
1251#[derive(
1252 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1253)]
1254pub struct Group {
1255 #[doc = "User-readable name of a Rippling group."]
1256 #[serde(default, skip_serializing_if = "Option::is_none")]
1257 pub name: Option<String>,
1258 #[serde(default, skip_serializing_if = "Option::is_none")]
1259 pub id: Option<String>,
1260 #[doc = "Your id for the group; this should a unique string identifier."]
1261 #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")]
1262 pub spoke_id: Option<String>,
1263 #[doc = "The version unique identifier of the group."]
1264 #[serde(default, skip_serializing_if = "Option::is_none")]
1265 pub version: Option<String>,
1266 #[doc = "An array of employee Rippling ids."]
1267 #[serde(default, skip_serializing_if = "Option::is_none")]
1268 pub users: Option<Vec<String>>,
1269}
1270
1271impl std::fmt::Display for Group {
1272 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1273 write!(
1274 f,
1275 "{}",
1276 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1277 )
1278 }
1279}
1280
1281#[cfg(feature = "tabled")]
1282impl tabled::Tabled for Group {
1283 const LENGTH: usize = 5;
1284 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1285 vec![
1286 if let Some(name) = &self.name {
1287 format!("{:?}", name).into()
1288 } else {
1289 String::new().into()
1290 },
1291 if let Some(id) = &self.id {
1292 format!("{:?}", id).into()
1293 } else {
1294 String::new().into()
1295 },
1296 if let Some(spoke_id) = &self.spoke_id {
1297 format!("{:?}", spoke_id).into()
1298 } else {
1299 String::new().into()
1300 },
1301 if let Some(version) = &self.version {
1302 format!("{:?}", version).into()
1303 } else {
1304 String::new().into()
1305 },
1306 if let Some(users) = &self.users {
1307 format!("{:?}", users).into()
1308 } else {
1309 String::new().into()
1310 },
1311 ]
1312 }
1313
1314 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1315 vec![
1316 "name".into(),
1317 "id".into(),
1318 "spoke_id".into(),
1319 "version".into(),
1320 "users".into(),
1321 ]
1322 }
1323}
1324
1325#[doc = "A company department object."]
1326#[derive(
1327 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1328)]
1329pub struct Department {
1330 #[doc = "Name of the department"]
1331 #[serde(default, skip_serializing_if = "Option::is_none")]
1332 pub name: Option<String>,
1333 #[doc = "Unique identifier of the department"]
1334 #[serde(default, skip_serializing_if = "Option::is_none")]
1335 pub id: Option<String>,
1336 #[doc = "id of the parent department, if one exists"]
1337 #[serde(default, skip_serializing_if = "Option::is_none")]
1338 pub parent: Option<String>,
1339}
1340
1341impl std::fmt::Display for Department {
1342 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1343 write!(
1344 f,
1345 "{}",
1346 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1347 )
1348 }
1349}
1350
1351#[cfg(feature = "tabled")]
1352impl tabled::Tabled for Department {
1353 const LENGTH: usize = 3;
1354 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1355 vec![
1356 if let Some(name) = &self.name {
1357 format!("{:?}", name).into()
1358 } else {
1359 String::new().into()
1360 },
1361 if let Some(id) = &self.id {
1362 format!("{:?}", id).into()
1363 } else {
1364 String::new().into()
1365 },
1366 if let Some(parent) = &self.parent {
1367 format!("{:?}", parent).into()
1368 } else {
1369 String::new().into()
1370 },
1371 ]
1372 }
1373
1374 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1375 vec!["name".into(), "id".into(), "parent".into()]
1376 }
1377}
1378
1379#[doc = "Denotes the type of the custom field."]
1380#[derive(
1381 serde :: Serialize,
1382 serde :: Deserialize,
1383 PartialEq,
1384 Hash,
1385 Debug,
1386 Clone,
1387 schemars :: JsonSchema,
1388 parse_display :: FromStr,
1389 parse_display :: Display,
1390)]
1391#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1392#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1393pub enum Type {
1394 #[serde(rename = "TEXT")]
1395 #[display("TEXT")]
1396 Text,
1397 #[serde(rename = "DATE")]
1398 #[display("DATE")]
1399 Date,
1400 #[serde(rename = "NUMBER")]
1401 #[display("NUMBER")]
1402 Number,
1403 #[serde(rename = "CURRENCY")]
1404 #[display("CURRENCY")]
1405 Currency,
1406 #[serde(rename = "PERCENTAGE")]
1407 #[display("PERCENTAGE")]
1408 Percentage,
1409 #[serde(rename = "SELECT")]
1410 #[display("SELECT")]
1411 Select,
1412 #[serde(rename = "FILE")]
1413 #[display("FILE")]
1414 File,
1415 #[serde(rename = "ID")]
1416 #[display("ID")]
1417 Id,
1418 #[serde(rename = "RADIO")]
1419 #[display("RADIO")]
1420 Radio,
1421 #[serde(rename = "TEXTAREA")]
1422 #[display("TEXTAREA")]
1423 Textarea,
1424}
1425
1426#[doc = "A Custom Fields object within Rippling."]
1427#[derive(
1428 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1429)]
1430pub struct CustomFields {
1431 #[doc = "The identifier of the specific custom field."]
1432 #[serde(rename = "Id", default, skip_serializing_if = "Option::is_none")]
1433 pub id: Option<String>,
1434 #[doc = "Denotes the type of the custom field."]
1435 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1436 pub type_: Option<Type>,
1437 #[doc = "The title of the custom field."]
1438 #[serde(default, skip_serializing_if = "Option::is_none")]
1439 pub title: Option<String>,
1440 #[doc = "Denotes whether the custom field is or is not mandatory"]
1441 #[serde(default, skip_serializing_if = "Option::is_none")]
1442 pub required: Option<bool>,
1443}
1444
1445impl std::fmt::Display for CustomFields {
1446 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1447 write!(
1448 f,
1449 "{}",
1450 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1451 )
1452 }
1453}
1454
1455#[cfg(feature = "tabled")]
1456impl tabled::Tabled for CustomFields {
1457 const LENGTH: usize = 4;
1458 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1459 vec![
1460 if let Some(id) = &self.id {
1461 format!("{:?}", id).into()
1462 } else {
1463 String::new().into()
1464 },
1465 if let Some(type_) = &self.type_ {
1466 format!("{:?}", type_).into()
1467 } else {
1468 String::new().into()
1469 },
1470 if let Some(title) = &self.title {
1471 format!("{:?}", title).into()
1472 } else {
1473 String::new().into()
1474 },
1475 if let Some(required) = &self.required {
1476 format!("{:?}", required).into()
1477 } else {
1478 String::new().into()
1479 },
1480 ]
1481 }
1482
1483 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1484 vec![
1485 "id".into(),
1486 "type_".into(),
1487 "title".into(),
1488 "required".into(),
1489 ]
1490 }
1491}
1492
1493#[doc = "A company object as represented within Rippling."]
1494#[derive(
1495 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1496)]
1497pub struct Company {
1498 #[serde(default, skip_serializing_if = "Option::is_none")]
1499 pub id: Option<String>,
1500 #[doc = "An address object as stored within Rippling."]
1501 #[serde(default, skip_serializing_if = "Option::is_none")]
1502 pub address: Option<Address>,
1503 #[serde(
1504 rename = "workLocations",
1505 default,
1506 skip_serializing_if = "Option::is_none"
1507 )]
1508 pub work_locations: Option<Vec<WorkLocation>>,
1509 #[serde(
1510 rename = "primaryEmail",
1511 default,
1512 skip_serializing_if = "Option::is_none"
1513 )]
1514 pub primary_email: Option<String>,
1515 #[serde(default, skip_serializing_if = "Option::is_none")]
1516 pub phone: Option<String>,
1517 #[serde(default, skip_serializing_if = "Option::is_none")]
1518 pub name: Option<String>,
1519 #[doc = "This model represents the legal entities inside of a given company. Legal entities \
1520 based in Canada (CA) are currently supported at this time."]
1521 #[serde(default, skip_serializing_if = "Option::is_none")]
1522 pub entities: Option<Entities>,
1523}
1524
1525impl std::fmt::Display for Company {
1526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1527 write!(
1528 f,
1529 "{}",
1530 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1531 )
1532 }
1533}
1534
1535#[cfg(feature = "tabled")]
1536impl tabled::Tabled for Company {
1537 const LENGTH: usize = 7;
1538 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1539 vec![
1540 if let Some(id) = &self.id {
1541 format!("{:?}", id).into()
1542 } else {
1543 String::new().into()
1544 },
1545 if let Some(address) = &self.address {
1546 format!("{:?}", address).into()
1547 } else {
1548 String::new().into()
1549 },
1550 if let Some(work_locations) = &self.work_locations {
1551 format!("{:?}", work_locations).into()
1552 } else {
1553 String::new().into()
1554 },
1555 if let Some(primary_email) = &self.primary_email {
1556 format!("{:?}", primary_email).into()
1557 } else {
1558 String::new().into()
1559 },
1560 if let Some(phone) = &self.phone {
1561 format!("{:?}", phone).into()
1562 } else {
1563 String::new().into()
1564 },
1565 if let Some(name) = &self.name {
1566 format!("{:?}", name).into()
1567 } else {
1568 String::new().into()
1569 },
1570 if let Some(entities) = &self.entities {
1571 format!("{:?}", entities).into()
1572 } else {
1573 String::new().into()
1574 },
1575 ]
1576 }
1577
1578 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1579 vec![
1580 "id".into(),
1581 "address".into(),
1582 "work_locations".into(),
1583 "primary_email".into(),
1584 "phone".into(),
1585 "name".into(),
1586 "entities".into(),
1587 ]
1588 }
1589}
1590
1591#[derive(
1592 serde :: Serialize,
1593 serde :: Deserialize,
1594 PartialEq,
1595 Hash,
1596 Debug,
1597 Clone,
1598 schemars :: JsonSchema,
1599 parse_display :: FromStr,
1600 parse_display :: Display,
1601)]
1602#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1603#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1604pub enum Status {
1605 #[serde(rename = "PENDING")]
1606 #[display("PENDING")]
1607 Pending,
1608 #[serde(rename = "APPROVED")]
1609 #[display("APPROVED")]
1610 Approved,
1611 #[serde(rename = "REJECTED")]
1612 #[display("REJECTED")]
1613 Rejected,
1614 #[serde(rename = "CANCELED")]
1615 #[display("CANCELED")]
1616 Canceled,
1617}
1618
1619#[derive(
1620 serde :: Serialize,
1621 serde :: Deserialize,
1622 PartialEq,
1623 Hash,
1624 Debug,
1625 Clone,
1626 schemars :: JsonSchema,
1627 parse_display :: FromStr,
1628 parse_display :: Display,
1629)]
1630#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1631#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1632pub enum LeaveTypeUniqueId {
1633 #[serde(rename = "VACATION")]
1634 #[display("VACATION")]
1635 Vacation,
1636 #[serde(rename = "SICK")]
1637 #[display("SICK")]
1638 Sick,
1639 #[serde(rename = "JURY_DUTY")]
1640 #[display("JURY_DUTY")]
1641 JuryDuty,
1642}
1643
1644#[derive(
1645 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1646)]
1647pub struct Dates {
1648 #[serde(default, skip_serializing_if = "Option::is_none")]
1649 pub date: Option<chrono::NaiveDate>,
1650 #[serde(
1651 rename = "numMinutes",
1652 default,
1653 skip_serializing_if = "Option::is_none"
1654 )]
1655 pub num_minutes: Option<i64>,
1656}
1657
1658impl std::fmt::Display for Dates {
1659 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1660 write!(
1661 f,
1662 "{}",
1663 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1664 )
1665 }
1666}
1667
1668#[cfg(feature = "tabled")]
1669impl tabled::Tabled for Dates {
1670 const LENGTH: usize = 2;
1671 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1672 vec![
1673 if let Some(date) = &self.date {
1674 format!("{:?}", date).into()
1675 } else {
1676 String::new().into()
1677 },
1678 if let Some(num_minutes) = &self.num_minutes {
1679 format!("{:?}", num_minutes).into()
1680 } else {
1681 String::new().into()
1682 },
1683 ]
1684 }
1685
1686 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1687 vec!["date".into(), "num_minutes".into()]
1688 }
1689}
1690
1691#[doc = "This indicates the system that manages the Leave Request. PTO = managed by Rippling's \
1692 Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = managed by \
1693 third-party partner Tilt."]
1694#[derive(
1695 serde :: Serialize,
1696 serde :: Deserialize,
1697 PartialEq,
1698 Hash,
1699 Debug,
1700 Clone,
1701 schemars :: JsonSchema,
1702 parse_display :: FromStr,
1703 parse_display :: Display,
1704)]
1705#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1706#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1707pub enum ManagedBy {
1708 #[serde(rename = "PTO")]
1709 #[display("PTO")]
1710 Pto,
1711 #[serde(rename = "LEAVES")]
1712 #[display("LEAVES")]
1713 Leaves,
1714 #[serde(rename = "TILT")]
1715 #[display("TILT")]
1716 Tilt,
1717}
1718
1719#[derive(
1720 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1721)]
1722pub struct PartialDays {
1723 #[serde(
1724 rename = "partialDay",
1725 default,
1726 skip_serializing_if = "Option::is_none"
1727 )]
1728 pub partial_day: Option<chrono::NaiveDate>,
1729 #[serde(
1730 rename = "numMinutes",
1731 default,
1732 skip_serializing_if = "Option::is_none"
1733 )]
1734 pub num_minutes: Option<i64>,
1735}
1736
1737impl std::fmt::Display for PartialDays {
1738 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1739 write!(
1740 f,
1741 "{}",
1742 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1743 )
1744 }
1745}
1746
1747#[cfg(feature = "tabled")]
1748impl tabled::Tabled for PartialDays {
1749 const LENGTH: usize = 2;
1750 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1751 vec![
1752 if let Some(partial_day) = &self.partial_day {
1753 format!("{:?}", partial_day).into()
1754 } else {
1755 String::new().into()
1756 },
1757 if let Some(num_minutes) = &self.num_minutes {
1758 format!("{:?}", num_minutes).into()
1759 } else {
1760 String::new().into()
1761 },
1762 ]
1763 }
1764
1765 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1766 vec!["partial_day".into(), "num_minutes".into()]
1767 }
1768}
1769
1770#[doc = "Leave request object."]
1771#[derive(
1772 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1773)]
1774pub struct LeaveRequest {
1775 #[doc = "Unique identifier of the leave request."]
1776 #[serde(default, skip_serializing_if = "Option::is_none")]
1777 pub id: Option<String>,
1778 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
1779 pub created_at: Option<String>,
1780 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
1781 pub updated_at: Option<String>,
1782 #[doc = "Unique identifier of the employee who is taking leave."]
1783 #[serde(default, skip_serializing_if = "Option::is_none")]
1784 pub role: Option<String>,
1785 #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")]
1786 pub role_name: Option<String>,
1787 #[serde(
1788 rename = "requestedBy",
1789 default,
1790 skip_serializing_if = "Option::is_none"
1791 )]
1792 pub requested_by: Option<String>,
1793 #[doc = "Unique identifier of the employee who made the request (in most cases this is the \
1794 same as role)."]
1795 #[serde(
1796 rename = "requestedByName",
1797 default,
1798 skip_serializing_if = "Option::is_none"
1799 )]
1800 pub requested_by_name: Option<String>,
1801 #[serde(default, skip_serializing_if = "Option::is_none")]
1802 pub status: Option<Status>,
1803 #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
1804 pub start_date: Option<String>,
1805 #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
1806 pub end_date: Option<String>,
1807 #[serde(
1808 rename = "startDateStartTime",
1809 default,
1810 skip_serializing_if = "Option::is_none"
1811 )]
1812 pub start_date_start_time: Option<String>,
1813 #[serde(
1814 rename = "endDateEndTime",
1815 default,
1816 skip_serializing_if = "Option::is_none"
1817 )]
1818 pub end_date_end_time: Option<String>,
1819 #[serde(
1820 rename = "startDateCustomHours",
1821 default,
1822 skip_serializing_if = "Option::is_none"
1823 )]
1824 pub start_date_custom_hours: Option<String>,
1825 #[serde(
1826 rename = "endDateCustomHours",
1827 default,
1828 skip_serializing_if = "Option::is_none"
1829 )]
1830 pub end_date_custom_hours: Option<String>,
1831 #[serde(default, skip_serializing_if = "Option::is_none")]
1832 pub comments: Option<String>,
1833 #[serde(rename = "numHours", default, skip_serializing_if = "Option::is_none")]
1834 pub num_hours: Option<i64>,
1835 #[serde(
1836 rename = "numMinutes",
1837 default,
1838 skip_serializing_if = "Option::is_none"
1839 )]
1840 pub num_minutes: Option<i64>,
1841 #[serde(
1842 rename = "leavePolicy",
1843 default,
1844 skip_serializing_if = "Option::is_none"
1845 )]
1846 pub leave_policy: Option<String>,
1847 #[serde(
1848 rename = "leaveTypeUniqueId",
1849 default,
1850 skip_serializing_if = "Option::is_none"
1851 )]
1852 pub leave_type_unique_id: Option<LeaveTypeUniqueId>,
1853 #[serde(
1854 rename = "policyDisplayName",
1855 default,
1856 skip_serializing_if = "Option::is_none"
1857 )]
1858 pub policy_display_name: Option<String>,
1859 #[serde(
1860 rename = "reasonForLeave",
1861 default,
1862 skip_serializing_if = "Option::is_none"
1863 )]
1864 pub reason_for_leave: Option<String>,
1865 #[serde(
1866 rename = "processedAt",
1867 default,
1868 skip_serializing_if = "Option::is_none"
1869 )]
1870 pub processed_at: Option<String>,
1871 #[doc = "Unique identifier of the employee who approved or rejected the request. This may be \
1872 null."]
1873 #[serde(
1874 rename = "processedBy",
1875 default,
1876 skip_serializing_if = "Option::is_none"
1877 )]
1878 pub processed_by: Option<String>,
1879 #[serde(
1880 rename = "processedByName",
1881 default,
1882 skip_serializing_if = "Option::is_none"
1883 )]
1884 pub processed_by_name: Option<String>,
1885 #[doc = "Timezone of the role. This will be work location timezone, or home timezone for \
1886 employees without a work location."]
1887 #[serde(
1888 rename = "roleTimezone",
1889 default,
1890 skip_serializing_if = "Option::is_none"
1891 )]
1892 pub role_timezone: Option<String>,
1893 #[serde(default, skip_serializing_if = "Option::is_none")]
1894 pub dates: Option<Vec<Dates>>,
1895 #[doc = "If the leave request is paid this will be TRUE. Otherwise, this will be FALSE."]
1896 #[serde(rename = "isPaid", default, skip_serializing_if = "Option::is_none")]
1897 pub is_paid: Option<bool>,
1898 #[doc = "This indicates the system that manages the Leave Request. PTO = managed by \
1899 Rippling's Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = \
1900 managed by third-party partner Tilt."]
1901 #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")]
1902 pub managed_by: Option<ManagedBy>,
1903 #[serde(
1904 rename = "partialDays",
1905 default,
1906 skip_serializing_if = "Option::is_none"
1907 )]
1908 pub partial_days: Option<Vec<Option<PartialDays>>>,
1909}
1910
1911impl std::fmt::Display for LeaveRequest {
1912 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1913 write!(
1914 f,
1915 "{}",
1916 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1917 )
1918 }
1919}
1920
1921#[cfg(feature = "tabled")]
1922impl tabled::Tabled for LeaveRequest {
1923 const LENGTH: usize = 29;
1924 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1925 vec![
1926 if let Some(id) = &self.id {
1927 format!("{:?}", id).into()
1928 } else {
1929 String::new().into()
1930 },
1931 if let Some(created_at) = &self.created_at {
1932 format!("{:?}", created_at).into()
1933 } else {
1934 String::new().into()
1935 },
1936 if let Some(updated_at) = &self.updated_at {
1937 format!("{:?}", updated_at).into()
1938 } else {
1939 String::new().into()
1940 },
1941 if let Some(role) = &self.role {
1942 format!("{:?}", role).into()
1943 } else {
1944 String::new().into()
1945 },
1946 if let Some(role_name) = &self.role_name {
1947 format!("{:?}", role_name).into()
1948 } else {
1949 String::new().into()
1950 },
1951 if let Some(requested_by) = &self.requested_by {
1952 format!("{:?}", requested_by).into()
1953 } else {
1954 String::new().into()
1955 },
1956 if let Some(requested_by_name) = &self.requested_by_name {
1957 format!("{:?}", requested_by_name).into()
1958 } else {
1959 String::new().into()
1960 },
1961 if let Some(status) = &self.status {
1962 format!("{:?}", status).into()
1963 } else {
1964 String::new().into()
1965 },
1966 if let Some(start_date) = &self.start_date {
1967 format!("{:?}", start_date).into()
1968 } else {
1969 String::new().into()
1970 },
1971 if let Some(end_date) = &self.end_date {
1972 format!("{:?}", end_date).into()
1973 } else {
1974 String::new().into()
1975 },
1976 if let Some(start_date_start_time) = &self.start_date_start_time {
1977 format!("{:?}", start_date_start_time).into()
1978 } else {
1979 String::new().into()
1980 },
1981 if let Some(end_date_end_time) = &self.end_date_end_time {
1982 format!("{:?}", end_date_end_time).into()
1983 } else {
1984 String::new().into()
1985 },
1986 if let Some(start_date_custom_hours) = &self.start_date_custom_hours {
1987 format!("{:?}", start_date_custom_hours).into()
1988 } else {
1989 String::new().into()
1990 },
1991 if let Some(end_date_custom_hours) = &self.end_date_custom_hours {
1992 format!("{:?}", end_date_custom_hours).into()
1993 } else {
1994 String::new().into()
1995 },
1996 if let Some(comments) = &self.comments {
1997 format!("{:?}", comments).into()
1998 } else {
1999 String::new().into()
2000 },
2001 if let Some(num_hours) = &self.num_hours {
2002 format!("{:?}", num_hours).into()
2003 } else {
2004 String::new().into()
2005 },
2006 if let Some(num_minutes) = &self.num_minutes {
2007 format!("{:?}", num_minutes).into()
2008 } else {
2009 String::new().into()
2010 },
2011 if let Some(leave_policy) = &self.leave_policy {
2012 format!("{:?}", leave_policy).into()
2013 } else {
2014 String::new().into()
2015 },
2016 if let Some(leave_type_unique_id) = &self.leave_type_unique_id {
2017 format!("{:?}", leave_type_unique_id).into()
2018 } else {
2019 String::new().into()
2020 },
2021 if let Some(policy_display_name) = &self.policy_display_name {
2022 format!("{:?}", policy_display_name).into()
2023 } else {
2024 String::new().into()
2025 },
2026 if let Some(reason_for_leave) = &self.reason_for_leave {
2027 format!("{:?}", reason_for_leave).into()
2028 } else {
2029 String::new().into()
2030 },
2031 if let Some(processed_at) = &self.processed_at {
2032 format!("{:?}", processed_at).into()
2033 } else {
2034 String::new().into()
2035 },
2036 if let Some(processed_by) = &self.processed_by {
2037 format!("{:?}", processed_by).into()
2038 } else {
2039 String::new().into()
2040 },
2041 if let Some(processed_by_name) = &self.processed_by_name {
2042 format!("{:?}", processed_by_name).into()
2043 } else {
2044 String::new().into()
2045 },
2046 if let Some(role_timezone) = &self.role_timezone {
2047 format!("{:?}", role_timezone).into()
2048 } else {
2049 String::new().into()
2050 },
2051 if let Some(dates) = &self.dates {
2052 format!("{:?}", dates).into()
2053 } else {
2054 String::new().into()
2055 },
2056 if let Some(is_paid) = &self.is_paid {
2057 format!("{:?}", is_paid).into()
2058 } else {
2059 String::new().into()
2060 },
2061 if let Some(managed_by) = &self.managed_by {
2062 format!("{:?}", managed_by).into()
2063 } else {
2064 String::new().into()
2065 },
2066 if let Some(partial_days) = &self.partial_days {
2067 format!("{:?}", partial_days).into()
2068 } else {
2069 String::new().into()
2070 },
2071 ]
2072 }
2073
2074 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2075 vec![
2076 "id".into(),
2077 "created_at".into(),
2078 "updated_at".into(),
2079 "role".into(),
2080 "role_name".into(),
2081 "requested_by".into(),
2082 "requested_by_name".into(),
2083 "status".into(),
2084 "start_date".into(),
2085 "end_date".into(),
2086 "start_date_start_time".into(),
2087 "end_date_end_time".into(),
2088 "start_date_custom_hours".into(),
2089 "end_date_custom_hours".into(),
2090 "comments".into(),
2091 "num_hours".into(),
2092 "num_minutes".into(),
2093 "leave_policy".into(),
2094 "leave_type_unique_id".into(),
2095 "policy_display_name".into(),
2096 "reason_for_leave".into(),
2097 "processed_at".into(),
2098 "processed_by".into(),
2099 "processed_by_name".into(),
2100 "role_timezone".into(),
2101 "dates".into(),
2102 "is_paid".into(),
2103 "managed_by".into(),
2104 "partial_days".into(),
2105 ]
2106 }
2107}
2108
2109#[doc = "Leave balances object"]
2110#[derive(
2111 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2112)]
2113pub struct LeaveBalances {
2114 #[doc = "This is the unique role ID of the company leave types. Corresponds to the ids in \
2115 response of GET Company Leave Types"]
2116 #[serde(
2117 rename = "companyLeaveType",
2118 default,
2119 skip_serializing_if = "Option::is_none"
2120 )]
2121 pub company_leave_type: Option<String>,
2122 #[doc = "true if employee's balance corresponding to the company leave type is unlimited, \
2123 else false"]
2124 #[serde(
2125 rename = "isBalanceUnlimited",
2126 default,
2127 skip_serializing_if = "Option::is_none"
2128 )]
2129 pub is_balance_unlimited: Option<bool>,
2130 #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \
2131 type with future leave requests considered."]
2132 #[serde(
2133 rename = "balanceWithFutureRequests",
2134 default,
2135 skip_serializing_if = "Option::is_none"
2136 )]
2137 pub balance_with_future_requests: Option<f64>,
2138 #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \
2139 type with future leave requests not considered."]
2140 #[serde(
2141 rename = "balanceWithoutFutureRequests",
2142 default,
2143 skip_serializing_if = "Option::is_none"
2144 )]
2145 pub balance_without_future_requests: Option<f64>,
2146}
2147
2148impl std::fmt::Display for LeaveBalances {
2149 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2150 write!(
2151 f,
2152 "{}",
2153 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2154 )
2155 }
2156}
2157
2158#[cfg(feature = "tabled")]
2159impl tabled::Tabled for LeaveBalances {
2160 const LENGTH: usize = 4;
2161 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2162 vec![
2163 if let Some(company_leave_type) = &self.company_leave_type {
2164 format!("{:?}", company_leave_type).into()
2165 } else {
2166 String::new().into()
2167 },
2168 if let Some(is_balance_unlimited) = &self.is_balance_unlimited {
2169 format!("{:?}", is_balance_unlimited).into()
2170 } else {
2171 String::new().into()
2172 },
2173 if let Some(balance_with_future_requests) = &self.balance_with_future_requests {
2174 format!("{:?}", balance_with_future_requests).into()
2175 } else {
2176 String::new().into()
2177 },
2178 if let Some(balance_without_future_requests) = &self.balance_without_future_requests {
2179 format!("{:?}", balance_without_future_requests).into()
2180 } else {
2181 String::new().into()
2182 },
2183 ]
2184 }
2185
2186 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2187 vec![
2188 "company_leave_type".into(),
2189 "is_balance_unlimited".into(),
2190 "balance_with_future_requests".into(),
2191 "balance_without_future_requests".into(),
2192 ]
2193 }
2194}
2195
2196#[doc = "Company leave request object"]
2197#[derive(
2198 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2199)]
2200pub struct CompanyLeaveType {
2201 #[doc = "Unique identifier of the company leave request"]
2202 #[serde(default, skip_serializing_if = "Option::is_none")]
2203 pub id: Option<String>,
2204 #[doc = "Company leave type key"]
2205 #[serde(rename = "leaveType", default, skip_serializing_if = "Option::is_none")]
2206 pub leave_type: Option<String>,
2207 #[doc = "Company leave type name"]
2208 #[serde(default, skip_serializing_if = "Option::is_none")]
2209 pub name: Option<String>,
2210 #[serde(default, skip_serializing_if = "Option::is_none")]
2211 pub description: Option<String>,
2212 #[doc = "Is leave type unpaid"]
2213 #[serde(rename = "isUnpaid", default, skip_serializing_if = "Option::is_none")]
2214 pub is_unpaid: Option<bool>,
2215}
2216
2217impl std::fmt::Display for CompanyLeaveType {
2218 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2219 write!(
2220 f,
2221 "{}",
2222 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2223 )
2224 }
2225}
2226
2227#[cfg(feature = "tabled")]
2228impl tabled::Tabled for CompanyLeaveType {
2229 const LENGTH: usize = 5;
2230 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2231 vec![
2232 if let Some(id) = &self.id {
2233 format!("{:?}", id).into()
2234 } else {
2235 String::new().into()
2236 },
2237 if let Some(leave_type) = &self.leave_type {
2238 format!("{:?}", leave_type).into()
2239 } else {
2240 String::new().into()
2241 },
2242 if let Some(name) = &self.name {
2243 format!("{:?}", name).into()
2244 } else {
2245 String::new().into()
2246 },
2247 if let Some(description) = &self.description {
2248 format!("{:?}", description).into()
2249 } else {
2250 String::new().into()
2251 },
2252 if let Some(is_unpaid) = &self.is_unpaid {
2253 format!("{:?}", is_unpaid).into()
2254 } else {
2255 String::new().into()
2256 },
2257 ]
2258 }
2259
2260 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2261 vec![
2262 "id".into(),
2263 "leave_type".into(),
2264 "name".into(),
2265 "description".into(),
2266 "is_unpaid".into(),
2267 ]
2268 }
2269}
2270
2271#[doc = "A team is a self-defined group of employees within Rippling."]
2272#[derive(
2273 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2274)]
2275pub struct Team {
2276 #[doc = "The identifier of the team."]
2277 #[serde(default, skip_serializing_if = "Option::is_none")]
2278 pub id: Option<String>,
2279 #[doc = "The name of the team."]
2280 #[serde(default, skip_serializing_if = "Option::is_none")]
2281 pub name: Option<String>,
2282 #[doc = "The parent team (if this team is a subteam within a larger team)."]
2283 #[serde(default, skip_serializing_if = "Option::is_none")]
2284 pub parent: Option<String>,
2285}
2286
2287impl std::fmt::Display for Team {
2288 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2289 write!(
2290 f,
2291 "{}",
2292 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2293 )
2294 }
2295}
2296
2297#[cfg(feature = "tabled")]
2298impl tabled::Tabled for Team {
2299 const LENGTH: usize = 3;
2300 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2301 vec![
2302 if let Some(id) = &self.id {
2303 format!("{:?}", id).into()
2304 } else {
2305 String::new().into()
2306 },
2307 if let Some(name) = &self.name {
2308 format!("{:?}", name).into()
2309 } else {
2310 String::new().into()
2311 },
2312 if let Some(parent) = &self.parent {
2313 format!("{:?}", parent).into()
2314 } else {
2315 String::new().into()
2316 },
2317 ]
2318 }
2319
2320 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2321 vec!["id".into(), "name".into(), "parent".into()]
2322 }
2323}
2324
2325#[doc = "Levels enable for self-defined,company-wide position levels, such as Manager, Engineering \
2326 Manager, Executive, etc."]
2327#[derive(
2328 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2329)]
2330pub struct Level {
2331 #[doc = "Unique identifier of the level."]
2332 #[serde(default, skip_serializing_if = "Option::is_none")]
2333 pub id: Option<String>,
2334 #[doc = "Name of the level."]
2335 #[serde(default, skip_serializing_if = "Option::is_none")]
2336 pub name: Option<String>,
2337 #[doc = "The unique identifier of the parent level."]
2338 #[serde(default, skip_serializing_if = "Option::is_none")]
2339 pub parent: Option<String>,
2340}
2341
2342impl std::fmt::Display for Level {
2343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2344 write!(
2345 f,
2346 "{}",
2347 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2348 )
2349 }
2350}
2351
2352#[cfg(feature = "tabled")]
2353impl tabled::Tabled for Level {
2354 const LENGTH: usize = 3;
2355 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2356 vec![
2357 if let Some(id) = &self.id {
2358 format!("{:?}", id).into()
2359 } else {
2360 String::new().into()
2361 },
2362 if let Some(name) = &self.name {
2363 format!("{:?}", name).into()
2364 } else {
2365 String::new().into()
2366 },
2367 if let Some(parent) = &self.parent {
2368 format!("{:?}", parent).into()
2369 } else {
2370 String::new().into()
2371 },
2372 ]
2373 }
2374
2375 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2376 vec!["id".into(), "name".into(), "parent".into()]
2377 }
2378}
2379
2380#[doc = "Information about the Rippling user whose token is being used to access Rippling's API."]
2381#[derive(
2382 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2383)]
2384pub struct AuthenticatedUserMe {
2385 #[doc = "Unied identifier of the user (likely an admin)."]
2386 #[serde(default, skip_serializing_if = "Option::is_none")]
2387 pub id: Option<String>,
2388 #[doc = "Work email of the user."]
2389 #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")]
2390 pub work_email: Option<String>,
2391 #[doc = "Unique identifier of the company."]
2392 #[serde(default, skip_serializing_if = "Option::is_none")]
2393 pub company: Option<String>,
2394}
2395
2396impl std::fmt::Display for AuthenticatedUserMe {
2397 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2398 write!(
2399 f,
2400 "{}",
2401 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2402 )
2403 }
2404}
2405
2406#[cfg(feature = "tabled")]
2407impl tabled::Tabled for AuthenticatedUserMe {
2408 const LENGTH: usize = 3;
2409 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2410 vec![
2411 if let Some(id) = &self.id {
2412 format!("{:?}", id).into()
2413 } else {
2414 String::new().into()
2415 },
2416 if let Some(work_email) = &self.work_email {
2417 format!("{:?}", work_email).into()
2418 } else {
2419 String::new().into()
2420 },
2421 if let Some(company) = &self.company {
2422 format!("{:?}", company).into()
2423 } else {
2424 String::new().into()
2425 },
2426 ]
2427 }
2428
2429 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2430 vec!["id".into(), "work_email".into(), "company".into()]
2431 }
2432}
2433
2434#[doc = "This payload should be used when updating existing groups."]
2435#[derive(
2436 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2437)]
2438pub struct GroupUpdatePayload {
2439 #[doc = "The name of the Group."]
2440 #[serde(default, skip_serializing_if = "Option::is_none")]
2441 pub name: Option<String>,
2442 #[doc = "The external identifier of the Group."]
2443 #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")]
2444 pub spoke_id: Option<String>,
2445 #[doc = "The array of users within the Group."]
2446 #[serde(default, skip_serializing_if = "Option::is_none")]
2447 pub users: Option<Vec<serde_json::Value>>,
2448 #[doc = "The version identifier of the Group."]
2449 #[serde(default, skip_serializing_if = "Option::is_none")]
2450 pub version: Option<String>,
2451}
2452
2453impl std::fmt::Display for GroupUpdatePayload {
2454 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2455 write!(
2456 f,
2457 "{}",
2458 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2459 )
2460 }
2461}
2462
2463#[cfg(feature = "tabled")]
2464impl tabled::Tabled for GroupUpdatePayload {
2465 const LENGTH: usize = 4;
2466 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2467 vec![
2468 if let Some(name) = &self.name {
2469 format!("{:?}", name).into()
2470 } else {
2471 String::new().into()
2472 },
2473 if let Some(spoke_id) = &self.spoke_id {
2474 format!("{:?}", spoke_id).into()
2475 } else {
2476 String::new().into()
2477 },
2478 if let Some(users) = &self.users {
2479 format!("{:?}", users).into()
2480 } else {
2481 String::new().into()
2482 },
2483 if let Some(version) = &self.version {
2484 format!("{:?}", version).into()
2485 } else {
2486 String::new().into()
2487 },
2488 ]
2489 }
2490
2491 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2492 vec![
2493 "name".into(),
2494 "spoke_id".into(),
2495 "users".into(),
2496 "version".into(),
2497 ]
2498 }
2499}
2500
2501#[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid once \
2502 the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per a custom \
2503 pay period."]
2504#[derive(
2505 serde :: Serialize,
2506 serde :: Deserialize,
2507 PartialEq,
2508 Hash,
2509 Debug,
2510 Clone,
2511 schemars :: JsonSchema,
2512 parse_display :: FromStr,
2513 parse_display :: Display,
2514)]
2515#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2516#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2517pub enum SalaryUnit {
2518 #[serde(rename = "HOUR")]
2519 #[display("HOUR")]
2520 Hour,
2521 #[serde(rename = "DAY")]
2522 #[display("DAY")]
2523 Day,
2524 #[serde(rename = "WEEK")]
2525 #[display("WEEK")]
2526 Week,
2527 #[serde(rename = "MONTH")]
2528 #[display("MONTH")]
2529 Month,
2530 #[serde(rename = "PAY_PERIOD")]
2531 #[display("PAY_PERIOD")]
2532 PayPeriod,
2533}
2534
2535#[doc = "The ENUM type of employment the user will have within Rippling."]
2536#[derive(
2537 serde :: Serialize,
2538 serde :: Deserialize,
2539 PartialEq,
2540 Hash,
2541 Debug,
2542 Clone,
2543 schemars :: JsonSchema,
2544 parse_display :: FromStr,
2545 parse_display :: Display,
2546)]
2547#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2548#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2549pub enum CandidateEmploymentType {
2550 #[serde(rename = "CONTRACTOR")]
2551 #[display("CONTRACTOR")]
2552 Contractor,
2553 #[serde(rename = "SALARIED_PT")]
2554 #[display("SALARIED_PT")]
2555 SalariedPt,
2556 #[serde(rename = "SALARIED_FT")]
2557 #[display("SALARIED_FT")]
2558 SalariedFt,
2559 #[serde(rename = "HOURLY_FT")]
2560 #[display("HOURLY_FT")]
2561 HourlyFt,
2562 #[serde(rename = "HOURLY_PT")]
2563 #[display("HOURLY_PT")]
2564 HourlyPt,
2565 #[serde(rename = "TEMP")]
2566 #[display("TEMP")]
2567 Temp,
2568}
2569
2570#[doc = "An array of json objects containing file names and public file URLs containing documents \
2571 pertaining to the candidate."]
2572#[derive(
2573 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2574)]
2575pub struct Attachments {
2576 #[doc = "The file name."]
2577 #[serde(default, skip_serializing_if = "Option::is_none")]
2578 pub file_name: Option<String>,
2579 #[doc = "The public URL and name of a pdf/docx/doc/odt file containing documents pertaining \
2580 to the candidate."]
2581 #[serde(default, skip_serializing_if = "Option::is_none")]
2582 pub file_url: Option<String>,
2583}
2584
2585impl std::fmt::Display for Attachments {
2586 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2587 write!(
2588 f,
2589 "{}",
2590 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2591 )
2592 }
2593}
2594
2595#[cfg(feature = "tabled")]
2596impl tabled::Tabled for Attachments {
2597 const LENGTH: usize = 2;
2598 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2599 vec![
2600 if let Some(file_name) = &self.file_name {
2601 format!("{:?}", file_name).into()
2602 } else {
2603 String::new().into()
2604 },
2605 if let Some(file_url) = &self.file_url {
2606 format!("{:?}", file_url).into()
2607 } else {
2608 String::new().into()
2609 },
2610 ]
2611 }
2612
2613 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2614 vec!["file_name".into(), "file_url".into()]
2615 }
2616}
2617
2618#[doc = "The Rippling candidate model."]
2619#[derive(
2620 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2621)]
2622pub struct Candidate {
2623 #[doc = "The candidate's name."]
2624 #[serde(default, skip_serializing_if = "Option::is_none")]
2625 pub name: Option<String>,
2626 #[doc = "The candidate's email."]
2627 #[serde(default, skip_serializing_if = "Option::is_none")]
2628 pub email: Option<String>,
2629 #[doc = "The candidate's job title."]
2630 #[serde(rename = "jobTitle", default, skip_serializing_if = "Option::is_none")]
2631 pub job_title: Option<String>,
2632 #[doc = "The candidate's phone number."]
2633 #[serde(
2634 rename = "phoneNumber",
2635 default,
2636 skip_serializing_if = "Option::is_none"
2637 )]
2638 pub phone_number: Option<String>,
2639 #[doc = "The unique identifier of the candidate from the ATS."]
2640 #[serde(
2641 rename = "candidateId",
2642 default,
2643 skip_serializing_if = "Option::is_none"
2644 )]
2645 pub candidate_id: Option<String>,
2646 #[doc = "The would-be start date of the candidate."]
2647 #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
2648 pub start_date: Option<chrono::NaiveDate>,
2649 #[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid \
2650 once the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per \
2651 a custom pay period."]
2652 #[serde(
2653 rename = "salaryUnit",
2654 default,
2655 skip_serializing_if = "Option::is_none"
2656 )]
2657 pub salary_unit: Option<SalaryUnit>,
2658 #[doc = "The decimal value that the candidate gets paid every salaryUnit time period."]
2659 #[serde(
2660 rename = "salaryPerUnit",
2661 default,
2662 skip_serializing_if = "Option::is_none"
2663 )]
2664 pub salary_per_unit: Option<f64>,
2665 #[doc = "The bonus cash given to the candidate as a part of a one time payment, with two \
2666 decimal digit precision."]
2667 #[serde(
2668 rename = "signingBonus",
2669 default,
2670 skip_serializing_if = "Option::is_none"
2671 )]
2672 pub signing_bonus: Option<f64>,
2673 #[doc = "A string field of the official currency as listed in ISO 4217."]
2674 #[serde(default, skip_serializing_if = "Option::is_none")]
2675 pub currency: Option<String>,
2676 #[doc = "The number of shares that will be given to the candidate."]
2677 #[serde(
2678 rename = "equityShares",
2679 default,
2680 skip_serializing_if = "Option::is_none"
2681 )]
2682 pub equity_shares: Option<i64>,
2683 #[doc = "This is the id of the department from GET/departments."]
2684 #[serde(default, skip_serializing_if = "Option::is_none")]
2685 pub department: Option<String>,
2686 #[doc = "The ENUM type of employment the user will have within Rippling."]
2687 #[serde(
2688 rename = "employmentType",
2689 default,
2690 skip_serializing_if = "Option::is_none"
2691 )]
2692 pub employment_type: Option<CandidateEmploymentType>,
2693 #[doc = "This is the id of the worklocation from GET/work_locations."]
2694 #[serde(
2695 rename = "workLocation",
2696 default,
2697 skip_serializing_if = "Option::is_none"
2698 )]
2699 pub work_location: Option<String>,
2700 #[serde(default, skip_serializing_if = "Option::is_none")]
2701 pub attachments: Option<Vec<Attachments>>,
2702}
2703
2704impl std::fmt::Display for Candidate {
2705 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2706 write!(
2707 f,
2708 "{}",
2709 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2710 )
2711 }
2712}
2713
2714#[cfg(feature = "tabled")]
2715impl tabled::Tabled for Candidate {
2716 const LENGTH: usize = 15;
2717 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2718 vec![
2719 if let Some(name) = &self.name {
2720 format!("{:?}", name).into()
2721 } else {
2722 String::new().into()
2723 },
2724 if let Some(email) = &self.email {
2725 format!("{:?}", email).into()
2726 } else {
2727 String::new().into()
2728 },
2729 if let Some(job_title) = &self.job_title {
2730 format!("{:?}", job_title).into()
2731 } else {
2732 String::new().into()
2733 },
2734 if let Some(phone_number) = &self.phone_number {
2735 format!("{:?}", phone_number).into()
2736 } else {
2737 String::new().into()
2738 },
2739 if let Some(candidate_id) = &self.candidate_id {
2740 format!("{:?}", candidate_id).into()
2741 } else {
2742 String::new().into()
2743 },
2744 if let Some(start_date) = &self.start_date {
2745 format!("{:?}", start_date).into()
2746 } else {
2747 String::new().into()
2748 },
2749 if let Some(salary_unit) = &self.salary_unit {
2750 format!("{:?}", salary_unit).into()
2751 } else {
2752 String::new().into()
2753 },
2754 if let Some(salary_per_unit) = &self.salary_per_unit {
2755 format!("{:?}", salary_per_unit).into()
2756 } else {
2757 String::new().into()
2758 },
2759 if let Some(signing_bonus) = &self.signing_bonus {
2760 format!("{:?}", signing_bonus).into()
2761 } else {
2762 String::new().into()
2763 },
2764 if let Some(currency) = &self.currency {
2765 format!("{:?}", currency).into()
2766 } else {
2767 String::new().into()
2768 },
2769 if let Some(equity_shares) = &self.equity_shares {
2770 format!("{:?}", equity_shares).into()
2771 } else {
2772 String::new().into()
2773 },
2774 if let Some(department) = &self.department {
2775 format!("{:?}", department).into()
2776 } else {
2777 String::new().into()
2778 },
2779 if let Some(employment_type) = &self.employment_type {
2780 format!("{:?}", employment_type).into()
2781 } else {
2782 String::new().into()
2783 },
2784 if let Some(work_location) = &self.work_location {
2785 format!("{:?}", work_location).into()
2786 } else {
2787 String::new().into()
2788 },
2789 if let Some(attachments) = &self.attachments {
2790 format!("{:?}", attachments).into()
2791 } else {
2792 String::new().into()
2793 },
2794 ]
2795 }
2796
2797 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2798 vec![
2799 "name".into(),
2800 "email".into(),
2801 "job_title".into(),
2802 "phone_number".into(),
2803 "candidate_id".into(),
2804 "start_date".into(),
2805 "salary_unit".into(),
2806 "salary_per_unit".into(),
2807 "signing_bonus".into(),
2808 "currency".into(),
2809 "equity_shares".into(),
2810 "department".into(),
2811 "employment_type".into(),
2812 "work_location".into(),
2813 "attachments".into(),
2814 ]
2815 }
2816}
2817
2818#[doc = "Geographic details from where the event was recorded."]
2819#[derive(
2820 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2821)]
2822pub struct RequestData {
2823 #[doc = "Event IP addresss."]
2824 #[serde(default, skip_serializing_if = "Option::is_none")]
2825 pub ip: Option<String>,
2826 #[doc = "City the event was triggered from."]
2827 #[serde(default, skip_serializing_if = "Option::is_none")]
2828 pub city: Option<String>,
2829 #[doc = "Country the event was triggered from."]
2830 #[serde(default, skip_serializing_if = "Option::is_none")]
2831 pub country: Option<String>,
2832 #[doc = "Latitude the event was triggered from."]
2833 #[serde(default, skip_serializing_if = "Option::is_none")]
2834 pub latitude: Option<String>,
2835 #[doc = "Longitude the event was triggered from."]
2836 #[serde(default, skip_serializing_if = "Option::is_none")]
2837 pub longitude: Option<String>,
2838}
2839
2840impl std::fmt::Display for RequestData {
2841 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2842 write!(
2843 f,
2844 "{}",
2845 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2846 )
2847 }
2848}
2849
2850#[cfg(feature = "tabled")]
2851impl tabled::Tabled for RequestData {
2852 const LENGTH: usize = 5;
2853 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2854 vec![
2855 if let Some(ip) = &self.ip {
2856 format!("{:?}", ip).into()
2857 } else {
2858 String::new().into()
2859 },
2860 if let Some(city) = &self.city {
2861 format!("{:?}", city).into()
2862 } else {
2863 String::new().into()
2864 },
2865 if let Some(country) = &self.country {
2866 format!("{:?}", country).into()
2867 } else {
2868 String::new().into()
2869 },
2870 if let Some(latitude) = &self.latitude {
2871 format!("{:?}", latitude).into()
2872 } else {
2873 String::new().into()
2874 },
2875 if let Some(longitude) = &self.longitude {
2876 format!("{:?}", longitude).into()
2877 } else {
2878 String::new().into()
2879 },
2880 ]
2881 }
2882
2883 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2884 vec![
2885 "ip".into(),
2886 "city".into(),
2887 "country".into(),
2888 "latitude".into(),
2889 "longitude".into(),
2890 ]
2891 }
2892}
2893
2894#[doc = "An ENUM value for the type of object."]
2895#[derive(
2896 serde :: Serialize,
2897 serde :: Deserialize,
2898 PartialEq,
2899 Hash,
2900 Debug,
2901 Clone,
2902 schemars :: JsonSchema,
2903 parse_display :: FromStr,
2904 parse_display :: Display,
2905)]
2906#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2907#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2908pub enum SubjectsType {
2909 #[serde(rename = "ROLE")]
2910 #[display("ROLE")]
2911 Role,
2912 #[serde(rename = "SPOKE")]
2913 #[display("SPOKE")]
2914 Spoke,
2915 #[serde(rename = "RPASS_ITEM")]
2916 #[display("RPASS_ITEM")]
2917 RpassItem,
2918 #[serde(rename = "SPOKE_USER")]
2919 #[display("SPOKE_USER")]
2920 SpokeUser,
2921 #[serde(rename = "GROUP")]
2922 #[display("GROUP")]
2923 Group,
2924}
2925
2926#[derive(
2927 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2928)]
2929pub struct Subjects {
2930 #[doc = "Unique key for the event object."]
2931 #[serde(default, skip_serializing_if = "Option::is_none")]
2932 pub instance: Option<String>,
2933 #[doc = "An ENUM value for the type of object."]
2934 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2935 pub type_: Option<SubjectsType>,
2936 #[doc = "Name used within Rippling."]
2937 #[serde(default, skip_serializing_if = "Option::is_none")]
2938 pub display_name: Option<String>,
2939 #[doc = "Icon used within Rippling."]
2940 #[serde(default, skip_serializing_if = "Option::is_none")]
2941 pub icon: Option<String>,
2942}
2943
2944impl std::fmt::Display for Subjects {
2945 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2946 write!(
2947 f,
2948 "{}",
2949 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2950 )
2951 }
2952}
2953
2954#[cfg(feature = "tabled")]
2955impl tabled::Tabled for Subjects {
2956 const LENGTH: usize = 4;
2957 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2958 vec![
2959 if let Some(instance) = &self.instance {
2960 format!("{:?}", instance).into()
2961 } else {
2962 String::new().into()
2963 },
2964 if let Some(type_) = &self.type_ {
2965 format!("{:?}", type_).into()
2966 } else {
2967 String::new().into()
2968 },
2969 if let Some(display_name) = &self.display_name {
2970 format!("{:?}", display_name).into()
2971 } else {
2972 String::new().into()
2973 },
2974 if let Some(icon) = &self.icon {
2975 format!("{:?}", icon).into()
2976 } else {
2977 String::new().into()
2978 },
2979 ]
2980 }
2981
2982 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2983 vec![
2984 "instance".into(),
2985 "type_".into(),
2986 "display_name".into(),
2987 "icon".into(),
2988 ]
2989 }
2990}
2991
2992#[doc = "An ENUM value for the type of the event."]
2993#[derive(
2994 serde :: Serialize,
2995 serde :: Deserialize,
2996 PartialEq,
2997 Hash,
2998 Debug,
2999 Clone,
3000 schemars :: JsonSchema,
3001 parse_display :: FromStr,
3002 parse_display :: Display,
3003)]
3004#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3005#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3006pub enum EventType {
3007 #[serde(rename = "EXTERNAL_ACCOUNT_CREATE")]
3008 #[display("EXTERNAL_ACCOUNT_CREATE")]
3009 ExternalAccountCreate,
3010 #[serde(rename = "EXTERNAL_ACCOUNT_INVITE")]
3011 #[display("EXTERNAL_ACCOUNT_INVITE")]
3012 ExternalAccountInvite,
3013 #[serde(rename = "EXTERNAL_ACCOUNT_DELETE")]
3014 #[display("EXTERNAL_ACCOUNT_DELETE")]
3015 ExternalAccountDelete,
3016 #[serde(rename = "EXTERNAL_ACCOUNT_SUSPEND")]
3017 #[display("EXTERNAL_ACCOUNT_SUSPEND")]
3018 ExternalAccountSuspend,
3019 #[serde(rename = "EXTERNAL_ACCOUNT_PASSWORD_RESET")]
3020 #[display("EXTERNAL_ACCOUNT_PASSWORD_RESET")]
3021 ExternalAccountPasswordReset,
3022 #[serde(rename = "EXTERNAL_GROUP_ADD")]
3023 #[display("EXTERNAL_GROUP_ADD")]
3024 ExternalGroupAdd,
3025 #[serde(rename = "EXTERNAL_GROUP_REMOVE")]
3026 #[display("EXTERNAL_GROUP_REMOVE")]
3027 ExternalGroupRemove,
3028 #[serde(rename = "EXTERNAL_SSO_GRANT")]
3029 #[display("EXTERNAL_SSO_GRANT")]
3030 ExternalSsoGrant,
3031 #[serde(rename = "EXTERNAL_SSO_REVOKE")]
3032 #[display("EXTERNAL_SSO_REVOKE")]
3033 ExternalSsoRevoke,
3034 #[serde(rename = "EXTERNAL_SSO_SIGNIN")]
3035 #[display("EXTERNAL_SSO_SIGNIN")]
3036 ExternalSsoSignin,
3037 #[serde(rename = "RPASS_ITEM_SHARED")]
3038 #[display("RPASS_ITEM_SHARED")]
3039 RpassItemShared,
3040 #[serde(rename = "RPASS_ITEM_UNSHARED")]
3041 #[display("RPASS_ITEM_UNSHARED")]
3042 RpassItemUnshared,
3043 #[serde(rename = "RPASS_ITEM_USED")]
3044 #[display("RPASS_ITEM_USED")]
3045 RpassItemUsed,
3046 #[serde(rename = "USER_LOGIN_SUCCESS")]
3047 #[display("USER_LOGIN_SUCCESS")]
3048 UserLoginSuccess,
3049 #[serde(rename = "USER_LOGIN_FAILED")]
3050 #[display("USER_LOGIN_FAILED")]
3051 UserLoginFailed,
3052 #[serde(rename = "ACCOUNT_PASSWORD_RESET")]
3053 #[display("ACCOUNT_PASSWORD_RESET")]
3054 AccountPasswordReset,
3055 #[serde(rename = "ACCOUNT_PASSWORD_CHANGED")]
3056 #[display("ACCOUNT_PASSWORD_CHANGED")]
3057 AccountPasswordChanged,
3058 #[serde(rename = "TWO_FACTOR_DEVICE_RESET")]
3059 #[display("TWO_FACTOR_DEVICE_RESET")]
3060 TwoFactorDeviceReset,
3061 #[serde(rename = "EXTERNAL_GROUP_MEMBER_REMOVE")]
3062 #[display("EXTERNAL_GROUP_MEMBER_REMOVE")]
3063 ExternalGroupMemberRemove,
3064}
3065
3066#[doc = "ENUM value for the type of actor."]
3067#[derive(
3068 serde :: Serialize,
3069 serde :: Deserialize,
3070 PartialEq,
3071 Hash,
3072 Debug,
3073 Clone,
3074 schemars :: JsonSchema,
3075 parse_display :: FromStr,
3076 parse_display :: Display,
3077)]
3078#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3079#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3080pub enum InitiatorType {
3081 #[serde(rename = "ROLE")]
3082 #[display("ROLE")]
3083 Role,
3084 #[serde(rename = "SYSTEM")]
3085 #[display("SYSTEM")]
3086 System,
3087 #[serde(rename = "EXTERNAL")]
3088 #[display("EXTERNAL")]
3089 External,
3090}
3091
3092#[doc = "The actor of the event."]
3093#[derive(
3094 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3095)]
3096pub struct Initiator {
3097 #[doc = "ENUM value for the type of actor."]
3098 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3099 pub type_: Option<InitiatorType>,
3100 #[doc = "A unique identifier for the employee that initiated the action, if the type is ROLE."]
3101 #[serde(default, skip_serializing_if = "Option::is_none")]
3102 pub role: Option<String>,
3103 #[doc = "The name used within Rippling."]
3104 #[serde(default, skip_serializing_if = "Option::is_none")]
3105 pub display_name: Option<String>,
3106 #[doc = "The icon used within Rippling."]
3107 #[serde(default, skip_serializing_if = "Option::is_none")]
3108 pub icon: Option<String>,
3109}
3110
3111impl std::fmt::Display for Initiator {
3112 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3113 write!(
3114 f,
3115 "{}",
3116 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3117 )
3118 }
3119}
3120
3121#[cfg(feature = "tabled")]
3122impl tabled::Tabled for Initiator {
3123 const LENGTH: usize = 4;
3124 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3125 vec![
3126 if let Some(type_) = &self.type_ {
3127 format!("{:?}", type_).into()
3128 } else {
3129 String::new().into()
3130 },
3131 if let Some(role) = &self.role {
3132 format!("{:?}", role).into()
3133 } else {
3134 String::new().into()
3135 },
3136 if let Some(display_name) = &self.display_name {
3137 format!("{:?}", display_name).into()
3138 } else {
3139 String::new().into()
3140 },
3141 if let Some(icon) = &self.icon {
3142 format!("{:?}", icon).into()
3143 } else {
3144 String::new().into()
3145 },
3146 ]
3147 }
3148
3149 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3150 vec![
3151 "type_".into(),
3152 "role".into(),
3153 "display_name".into(),
3154 "icon".into(),
3155 ]
3156 }
3157}
3158
3159#[doc = "Reason for the event, tied to the type of eveent."]
3160#[derive(
3161 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3162)]
3163pub struct EventReason {
3164 #[doc = "Reason for the event."]
3165 #[serde(default, skip_serializing_if = "Option::is_none")]
3166 pub reason: Option<String>,
3167 #[doc = "Message of the event."]
3168 #[serde(default, skip_serializing_if = "Option::is_none")]
3169 pub message: Option<String>,
3170}
3171
3172impl std::fmt::Display for EventReason {
3173 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3174 write!(
3175 f,
3176 "{}",
3177 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3178 )
3179 }
3180}
3181
3182#[cfg(feature = "tabled")]
3183impl tabled::Tabled for EventReason {
3184 const LENGTH: usize = 2;
3185 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3186 vec![
3187 if let Some(reason) = &self.reason {
3188 format!("{:?}", reason).into()
3189 } else {
3190 String::new().into()
3191 },
3192 if let Some(message) = &self.message {
3193 format!("{:?}", message).into()
3194 } else {
3195 String::new().into()
3196 },
3197 ]
3198 }
3199
3200 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3201 vec!["reason".into(), "message".into()]
3202 }
3203}
3204
3205#[doc = "The event model for company activity.\n\nPlease note, the event type can be one of the \
3206 following:\n\n- EXTERNAL_ACCONT_CREATE\n- EXTERNAL_ACCOUNT_INVITE\n- \
3207 EXTERNAL_ACCOUNT_DELETE\n- EXTERNAL_ACCOUNT_SUSPEND\n- EXTERNAL_ACCOUNT_PASSWORD_RESET\n- \
3208 EXTERNAL_GROUP_ADD\n- EXTERNAL_GROUP_REMOVE\n- EXTERNAL_GROUP_MEMBER_REMOVE\n- \
3209 EXTERNAL_GROUP_MEMBER_ADD\n- EXTERNAL_SSO_GRANT\n- EXTERNAL_SSO_REVOKE\n- \
3210 EXTERNAL_SSO_SIGNIN\n- RPASS_ITEM_SHARED\n- RPASS_ITEM_UNSHARED\n- RPASS_ITEM_USED\n- \
3211 USER_LOGIN_SUCCESS\n- USER_LOGIN_FAILED\n- ACCOUNT_PASSWORD_RESET\n- \
3212 ACCOUNT_PASSWORD_CHANGED\n- TWO_FACTOR_DEVICE_RESET\n"]
3213#[derive(
3214 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3215)]
3216pub struct Event {
3217 #[doc = "Unique identifier of the event."]
3218 #[serde(default, skip_serializing_if = "Option::is_none")]
3219 pub id: Option<String>,
3220 #[doc = "Geographic details from where the event was recorded."]
3221 #[serde(default, skip_serializing_if = "Option::is_none")]
3222 pub request_data: Option<RequestData>,
3223 #[doc = "An array of event identifiers that are linked to the event."]
3224 #[serde(default, skip_serializing_if = "Option::is_none")]
3225 pub linked_events: Option<Vec<String>>,
3226 #[doc = "The list of objects of the event."]
3227 #[serde(default, skip_serializing_if = "Option::is_none")]
3228 pub subjects: Option<Vec<Option<Subjects>>>,
3229 #[doc = "An ENUM value for the type of the event."]
3230 #[serde(default, skip_serializing_if = "Option::is_none")]
3231 pub event_type: Option<EventType>,
3232 #[doc = "Timestamp at which the event was recorded."]
3233 #[serde(default, skip_serializing_if = "Option::is_none")]
3234 pub timestamp: Option<String>,
3235 #[doc = "Unique identifier for the company."]
3236 #[serde(default, skip_serializing_if = "Option::is_none")]
3237 pub company: Option<String>,
3238 #[doc = "Unique identifier for the external application for which the event was recorded. \
3239 This will be Null for events that don't correspond to an external appliction (e.g. \
3240 Rippling system and RPass events)."]
3241 #[serde(default, skip_serializing_if = "Option::is_none")]
3242 pub spoke: Option<String>,
3243 #[doc = "The actor of the event."]
3244 #[serde(default, skip_serializing_if = "Option::is_none")]
3245 pub initiator: Option<Initiator>,
3246 #[doc = "Reason for the event, tied to the type of eveent."]
3247 #[serde(default, skip_serializing_if = "Option::is_none")]
3248 pub event_reason: Option<EventReason>,
3249 #[doc = "Display name for the event, tied to the type of event."]
3250 #[serde(default, skip_serializing_if = "Option::is_none")]
3251 pub name: Option<String>,
3252}
3253
3254impl std::fmt::Display for Event {
3255 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3256 write!(
3257 f,
3258 "{}",
3259 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3260 )
3261 }
3262}
3263
3264#[cfg(feature = "tabled")]
3265impl tabled::Tabled for Event {
3266 const LENGTH: usize = 11;
3267 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3268 vec![
3269 if let Some(id) = &self.id {
3270 format!("{:?}", id).into()
3271 } else {
3272 String::new().into()
3273 },
3274 if let Some(request_data) = &self.request_data {
3275 format!("{:?}", request_data).into()
3276 } else {
3277 String::new().into()
3278 },
3279 if let Some(linked_events) = &self.linked_events {
3280 format!("{:?}", linked_events).into()
3281 } else {
3282 String::new().into()
3283 },
3284 if let Some(subjects) = &self.subjects {
3285 format!("{:?}", subjects).into()
3286 } else {
3287 String::new().into()
3288 },
3289 if let Some(event_type) = &self.event_type {
3290 format!("{:?}", event_type).into()
3291 } else {
3292 String::new().into()
3293 },
3294 if let Some(timestamp) = &self.timestamp {
3295 format!("{:?}", timestamp).into()
3296 } else {
3297 String::new().into()
3298 },
3299 if let Some(company) = &self.company {
3300 format!("{:?}", company).into()
3301 } else {
3302 String::new().into()
3303 },
3304 if let Some(spoke) = &self.spoke {
3305 format!("{:?}", spoke).into()
3306 } else {
3307 String::new().into()
3308 },
3309 if let Some(initiator) = &self.initiator {
3310 format!("{:?}", initiator).into()
3311 } else {
3312 String::new().into()
3313 },
3314 if let Some(event_reason) = &self.event_reason {
3315 format!("{:?}", event_reason).into()
3316 } else {
3317 String::new().into()
3318 },
3319 if let Some(name) = &self.name {
3320 format!("{:?}", name).into()
3321 } else {
3322 String::new().into()
3323 },
3324 ]
3325 }
3326
3327 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3328 vec![
3329 "id".into(),
3330 "request_data".into(),
3331 "linked_events".into(),
3332 "subjects".into(),
3333 "event_type".into(),
3334 "timestamp".into(),
3335 "company".into(),
3336 "spoke".into(),
3337 "initiator".into(),
3338 "event_reason".into(),
3339 "name".into(),
3340 ]
3341 }
3342}
3343
3344#[doc = "CustomField."]
3345#[derive(
3346 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3347)]
3348pub struct CustomField {
3349 #[serde(
3350 rename = "customFieldTitle1",
3351 default,
3352 skip_serializing_if = "Option::is_none"
3353 )]
3354 pub custom_field_title_1: Option<String>,
3355 #[serde(
3356 rename = "customFieldTitleN",
3357 default,
3358 skip_serializing_if = "Option::is_none"
3359 )]
3360 pub custom_field_title_n: Option<String>,
3361}
3362
3363impl std::fmt::Display for CustomField {
3364 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3365 write!(
3366 f,
3367 "{}",
3368 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3369 )
3370 }
3371}
3372
3373#[cfg(feature = "tabled")]
3374impl tabled::Tabled for CustomField {
3375 const LENGTH: usize = 2;
3376 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3377 vec![
3378 if let Some(custom_field_title_1) = &self.custom_field_title_1 {
3379 format!("{:?}", custom_field_title_1).into()
3380 } else {
3381 String::new().into()
3382 },
3383 if let Some(custom_field_title_n) = &self.custom_field_title_n {
3384 format!("{:?}", custom_field_title_n).into()
3385 } else {
3386 String::new().into()
3387 },
3388 ]
3389 }
3390
3391 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3392 vec!["custom_field_title_1".into(), "custom_field_title_n".into()]
3393 }
3394}
3395
3396#[derive(
3397 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3398)]
3399pub struct EntityInfo {
3400 #[doc = "The legal name of the entity"]
3401 #[serde(rename = "legalName", default, skip_serializing_if = "Option::is_none")]
3402 pub legal_name: Option<String>,
3403 #[doc = "The Canada Business Number"]
3404 #[serde(
3405 rename = "businessNumber",
3406 default,
3407 skip_serializing_if = "Option::is_none"
3408 )]
3409 pub business_number: Option<String>,
3410}
3411
3412impl std::fmt::Display for EntityInfo {
3413 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3414 write!(
3415 f,
3416 "{}",
3417 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3418 )
3419 }
3420}
3421
3422#[cfg(feature = "tabled")]
3423impl tabled::Tabled for EntityInfo {
3424 const LENGTH: usize = 2;
3425 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3426 vec![
3427 if let Some(legal_name) = &self.legal_name {
3428 format!("{:?}", legal_name).into()
3429 } else {
3430 String::new().into()
3431 },
3432 if let Some(business_number) = &self.business_number {
3433 format!("{:?}", business_number).into()
3434 } else {
3435 String::new().into()
3436 },
3437 ]
3438 }
3439
3440 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3441 vec!["legal_name".into(), "business_number".into()]
3442 }
3443}
3444
3445#[derive(
3446 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3447)]
3448pub struct Ca {
3449 #[doc = "The unique Rippling ID of the legal entity"]
3450 #[serde(default, skip_serializing_if = "Option::is_none")]
3451 pub id: Option<String>,
3452 #[serde(
3453 rename = "entityInfo",
3454 default,
3455 skip_serializing_if = "Option::is_none"
3456 )]
3457 pub entity_info: Option<EntityInfo>,
3458 #[doc = "If set to true, the legal entity is Rippling's EOR. If set to false, the legal \
3459 entity is not on Rippling's EOR."]
3460 #[serde(rename = "isEor", default, skip_serializing_if = "Option::is_none")]
3461 pub is_eor: Option<bool>,
3462}
3463
3464impl std::fmt::Display for Ca {
3465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3466 write!(
3467 f,
3468 "{}",
3469 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3470 )
3471 }
3472}
3473
3474#[cfg(feature = "tabled")]
3475impl tabled::Tabled for Ca {
3476 const LENGTH: usize = 3;
3477 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3478 vec![
3479 if let Some(id) = &self.id {
3480 format!("{:?}", id).into()
3481 } else {
3482 String::new().into()
3483 },
3484 if let Some(entity_info) = &self.entity_info {
3485 format!("{:?}", entity_info).into()
3486 } else {
3487 String::new().into()
3488 },
3489 if let Some(is_eor) = &self.is_eor {
3490 format!("{:?}", is_eor).into()
3491 } else {
3492 String::new().into()
3493 },
3494 ]
3495 }
3496
3497 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3498 vec!["id".into(), "entity_info".into(), "is_eor".into()]
3499 }
3500}
3501
3502#[doc = "This model represents the legal entities inside of a given company. Legal entities based \
3503 in Canada (CA) are currently supported at this time."]
3504#[derive(
3505 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3506)]
3507pub struct Entities {
3508 #[doc = "CA represents Canada."]
3509 #[serde(rename = "CA", default, skip_serializing_if = "Option::is_none")]
3510 pub ca: Option<Vec<Ca>>,
3511}
3512
3513impl std::fmt::Display for Entities {
3514 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3515 write!(
3516 f,
3517 "{}",
3518 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3519 )
3520 }
3521}
3522
3523#[cfg(feature = "tabled")]
3524impl tabled::Tabled for Entities {
3525 const LENGTH: usize = 1;
3526 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3527 vec![if let Some(ca) = &self.ca {
3528 format!("{:?}", ca).into()
3529 } else {
3530 String::new().into()
3531 }]
3532 }
3533
3534 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3535 vec!["ca".into()]
3536 }
3537}
3538
3539#[derive(
3540 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3541)]
3542pub struct PostGroupsRequestBody {
3543 #[doc = "User-readable name of the group."]
3544 #[serde(default, skip_serializing_if = "Option::is_none")]
3545 pub name: Option<String>,
3546 #[doc = "The unique ID for the group, this can be the unique identifier for the group entity \
3547 object within your application."]
3548 #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")]
3549 pub spoke_id: Option<String>,
3550 #[doc = "An array of Rippling IDs that will be in the group."]
3551 #[serde(default, skip_serializing_if = "Option::is_none")]
3552 pub users: Option<Vec<String>>,
3553}
3554
3555impl std::fmt::Display for PostGroupsRequestBody {
3556 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3557 write!(
3558 f,
3559 "{}",
3560 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3561 )
3562 }
3563}
3564
3565#[cfg(feature = "tabled")]
3566impl tabled::Tabled for PostGroupsRequestBody {
3567 const LENGTH: usize = 3;
3568 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3569 vec![
3570 if let Some(name) = &self.name {
3571 format!("{:?}", name).into()
3572 } else {
3573 String::new().into()
3574 },
3575 if let Some(spoke_id) = &self.spoke_id {
3576 format!("{:?}", spoke_id).into()
3577 } else {
3578 String::new().into()
3579 },
3580 if let Some(users) = &self.users {
3581 format!("{:?}", users).into()
3582 } else {
3583 String::new().into()
3584 },
3585 ]
3586 }
3587
3588 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3589 vec!["name".into(), "spoke_id".into(), "users".into()]
3590 }
3591}
3592
3593#[derive(
3594 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3595)]
3596pub struct PostLeaveRequestsRequestBody {
3597 #[doc = "Unique identifier of the employee who is taking leave."]
3598 pub role: String,
3599 #[serde(
3600 rename = "requestedBy",
3601 default,
3602 skip_serializing_if = "Option::is_none"
3603 )]
3604 pub requested_by: Option<String>,
3605 #[doc = "The status to create the leave request in. Only TILT managed requests can take a \
3606 status other than PENDING."]
3607 #[serde(default, skip_serializing_if = "Option::is_none")]
3608 pub status: Option<String>,
3609 #[serde(rename = "startDate")]
3610 pub start_date: String,
3611 #[serde(rename = "endDate")]
3612 pub end_date: String,
3613 #[serde(
3614 rename = "startDateStartTime",
3615 default,
3616 skip_serializing_if = "Option::is_none"
3617 )]
3618 pub start_date_start_time: Option<String>,
3619 #[serde(
3620 rename = "endDateEndTime",
3621 default,
3622 skip_serializing_if = "Option::is_none"
3623 )]
3624 pub end_date_end_time: Option<String>,
3625 #[serde(
3626 rename = "startDateCustomHours",
3627 default,
3628 skip_serializing_if = "Option::is_none"
3629 )]
3630 pub start_date_custom_hours: Option<String>,
3631 #[serde(
3632 rename = "endDateCustomHours",
3633 default,
3634 skip_serializing_if = "Option::is_none"
3635 )]
3636 pub end_date_custom_hours: Option<String>,
3637 #[doc = "Unique identifier of the company leave type"]
3638 #[serde(rename = "companyLeaveType")]
3639 pub company_leave_type: String,
3640 #[doc = "Unique identifier of the leave policy. Required if request is not managed by TILT"]
3641 #[serde(rename = "leavePolicy")]
3642 pub leave_policy: String,
3643 #[serde(
3644 rename = "reasonForLeave",
3645 default,
3646 skip_serializing_if = "Option::is_none"
3647 )]
3648 pub reason_for_leave: Option<String>,
3649 #[doc = "String identifier for third party that manages this leave request. This may be null."]
3650 #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")]
3651 pub managed_by: Option<String>,
3652 #[doc = "Object id for corresponding leave obejct in third party system. This may be null."]
3653 #[serde(
3654 rename = "externalId",
3655 default,
3656 skip_serializing_if = "Option::is_none"
3657 )]
3658 pub external_id: Option<String>,
3659}
3660
3661impl std::fmt::Display for PostLeaveRequestsRequestBody {
3662 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3663 write!(
3664 f,
3665 "{}",
3666 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3667 )
3668 }
3669}
3670
3671#[cfg(feature = "tabled")]
3672impl tabled::Tabled for PostLeaveRequestsRequestBody {
3673 const LENGTH: usize = 14;
3674 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3675 vec![
3676 self.role.clone().into(),
3677 if let Some(requested_by) = &self.requested_by {
3678 format!("{:?}", requested_by).into()
3679 } else {
3680 String::new().into()
3681 },
3682 if let Some(status) = &self.status {
3683 format!("{:?}", status).into()
3684 } else {
3685 String::new().into()
3686 },
3687 self.start_date.clone().into(),
3688 self.end_date.clone().into(),
3689 if let Some(start_date_start_time) = &self.start_date_start_time {
3690 format!("{:?}", start_date_start_time).into()
3691 } else {
3692 String::new().into()
3693 },
3694 if let Some(end_date_end_time) = &self.end_date_end_time {
3695 format!("{:?}", end_date_end_time).into()
3696 } else {
3697 String::new().into()
3698 },
3699 if let Some(start_date_custom_hours) = &self.start_date_custom_hours {
3700 format!("{:?}", start_date_custom_hours).into()
3701 } else {
3702 String::new().into()
3703 },
3704 if let Some(end_date_custom_hours) = &self.end_date_custom_hours {
3705 format!("{:?}", end_date_custom_hours).into()
3706 } else {
3707 String::new().into()
3708 },
3709 self.company_leave_type.clone().into(),
3710 self.leave_policy.clone().into(),
3711 if let Some(reason_for_leave) = &self.reason_for_leave {
3712 format!("{:?}", reason_for_leave).into()
3713 } else {
3714 String::new().into()
3715 },
3716 if let Some(managed_by) = &self.managed_by {
3717 format!("{:?}", managed_by).into()
3718 } else {
3719 String::new().into()
3720 },
3721 if let Some(external_id) = &self.external_id {
3722 format!("{:?}", external_id).into()
3723 } else {
3724 String::new().into()
3725 },
3726 ]
3727 }
3728
3729 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3730 vec![
3731 "role".into(),
3732 "requested_by".into(),
3733 "status".into(),
3734 "start_date".into(),
3735 "end_date".into(),
3736 "start_date_start_time".into(),
3737 "end_date_end_time".into(),
3738 "start_date_custom_hours".into(),
3739 "end_date_custom_hours".into(),
3740 "company_leave_type".into(),
3741 "leave_policy".into(),
3742 "reason_for_leave".into(),
3743 "managed_by".into(),
3744 "external_id".into(),
3745 ]
3746 }
3747}
3748
3749#[derive(
3750 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3751)]
3752pub struct GetLeaveBalancesResponse {
3753 #[serde(default, skip_serializing_if = "Option::is_none")]
3754 pub role: Option<String>,
3755 #[doc = "Leave balances object"]
3756 #[serde(default, skip_serializing_if = "Option::is_none")]
3757 pub balances: Option<LeaveBalances>,
3758}
3759
3760impl std::fmt::Display for GetLeaveBalancesResponse {
3761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3762 write!(
3763 f,
3764 "{}",
3765 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3766 )
3767 }
3768}
3769
3770#[cfg(feature = "tabled")]
3771impl tabled::Tabled for GetLeaveBalancesResponse {
3772 const LENGTH: usize = 2;
3773 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3774 vec![
3775 if let Some(role) = &self.role {
3776 format!("{:?}", role).into()
3777 } else {
3778 String::new().into()
3779 },
3780 if let Some(balances) = &self.balances {
3781 format!("{:?}", balances).into()
3782 } else {
3783 String::new().into()
3784 },
3785 ]
3786 }
3787
3788 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3789 vec!["role".into(), "balances".into()]
3790 }
3791}
3792
3793#[derive(
3794 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3795)]
3796pub struct GetLeaveBalanceResponse {
3797 #[serde(default, skip_serializing_if = "Option::is_none")]
3798 pub role: Option<String>,
3799 #[doc = "Leave balances object"]
3800 #[serde(default, skip_serializing_if = "Option::is_none")]
3801 pub balances: Option<LeaveBalances>,
3802}
3803
3804impl std::fmt::Display for GetLeaveBalanceResponse {
3805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3806 write!(
3807 f,
3808 "{}",
3809 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3810 )
3811 }
3812}
3813
3814#[cfg(feature = "tabled")]
3815impl tabled::Tabled for GetLeaveBalanceResponse {
3816 const LENGTH: usize = 2;
3817 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3818 vec![
3819 if let Some(role) = &self.role {
3820 format!("{:?}", role).into()
3821 } else {
3822 String::new().into()
3823 },
3824 if let Some(balances) = &self.balances {
3825 format!("{:?}", balances).into()
3826 } else {
3827 String::new().into()
3828 },
3829 ]
3830 }
3831
3832 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3833 vec!["role".into(), "balances".into()]
3834 }
3835}
3836
3837#[derive(
3838 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3839)]
3840pub struct Data {
3841 #[serde(default, skip_serializing_if = "Option::is_none")]
3842 pub events: Option<Vec<Event>>,
3843 #[serde(default, skip_serializing_if = "Option::is_none")]
3844 pub next: Option<String>,
3845}
3846
3847impl std::fmt::Display for Data {
3848 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3849 write!(
3850 f,
3851 "{}",
3852 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3853 )
3854 }
3855}
3856
3857#[cfg(feature = "tabled")]
3858impl tabled::Tabled for Data {
3859 const LENGTH: usize = 2;
3860 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3861 vec![
3862 if let Some(events) = &self.events {
3863 format!("{:?}", events).into()
3864 } else {
3865 String::new().into()
3866 },
3867 if let Some(next) = &self.next {
3868 format!("{:?}", next).into()
3869 } else {
3870 String::new().into()
3871 },
3872 ]
3873 }
3874
3875 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3876 vec!["events".into(), "next".into()]
3877 }
3878}
3879
3880#[derive(
3881 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3882)]
3883pub struct GetCompanyActivityResponse {
3884 #[serde(default, skip_serializing_if = "Option::is_none")]
3885 pub data: Option<Data>,
3886 #[serde(default, skip_serializing_if = "Option::is_none")]
3887 pub error: Option<String>,
3888}
3889
3890impl std::fmt::Display for GetCompanyActivityResponse {
3891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3892 write!(
3893 f,
3894 "{}",
3895 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3896 )
3897 }
3898}
3899
3900#[cfg(feature = "tabled")]
3901impl tabled::Tabled for GetCompanyActivityResponse {
3902 const LENGTH: usize = 2;
3903 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3904 vec![
3905 if let Some(data) = &self.data {
3906 format!("{:?}", data).into()
3907 } else {
3908 String::new().into()
3909 },
3910 if let Some(error) = &self.error {
3911 format!("{:?}", error).into()
3912 } else {
3913 String::new().into()
3914 },
3915 ]
3916 }
3917
3918 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3919 vec!["data".into(), "error".into()]
3920 }
3921}
3922
3923#[derive(
3924 serde :: Serialize,
3925 serde :: Deserialize,
3926 PartialEq,
3927 Hash,
3928 Debug,
3929 Clone,
3930 schemars :: JsonSchema,
3931 parse_display :: FromStr,
3932 parse_display :: Display,
3933)]
3934#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3935#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3936pub enum Action {
3937 #[serde(rename = "approve")]
3938 #[display("approve")]
3939 Approve,
3940 #[serde(rename = "decline")]
3941 #[display("decline")]
3942 Decline,
3943}
3944
3945#[derive(
3946 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3947)]
3948pub struct PatchLeaveRequestsLeaveRequestIdRequestBody {
3949 #[serde(
3950 rename = "requestedBy",
3951 default,
3952 skip_serializing_if = "Option::is_none"
3953 )]
3954 pub requested_by: Option<String>,
3955 #[doc = "Change the status of a request. This is only possible for TILT managed requests."]
3956 #[serde(default, skip_serializing_if = "Option::is_none")]
3957 pub status: Option<String>,
3958 #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
3959 pub start_date: Option<String>,
3960 #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
3961 pub end_date: Option<String>,
3962 #[serde(
3963 rename = "startDateStartTime",
3964 default,
3965 skip_serializing_if = "Option::is_none"
3966 )]
3967 pub start_date_start_time: Option<String>,
3968 #[serde(
3969 rename = "endDateEndTime",
3970 default,
3971 skip_serializing_if = "Option::is_none"
3972 )]
3973 pub end_date_end_time: Option<String>,
3974 #[serde(
3975 rename = "startDateCustomHours",
3976 default,
3977 skip_serializing_if = "Option::is_none"
3978 )]
3979 pub start_date_custom_hours: Option<String>,
3980 #[serde(
3981 rename = "endDateCustomHours",
3982 default,
3983 skip_serializing_if = "Option::is_none"
3984 )]
3985 pub end_date_custom_hours: Option<String>,
3986 #[doc = "Updated reason for leave request. This may be updated even for an APPROVED request."]
3987 #[serde(
3988 rename = "reasonForLeave",
3989 default,
3990 skip_serializing_if = "Option::is_none"
3991 )]
3992 pub reason_for_leave: Option<String>,
3993}
3994
3995impl std::fmt::Display for PatchLeaveRequestsLeaveRequestIdRequestBody {
3996 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3997 write!(
3998 f,
3999 "{}",
4000 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4001 )
4002 }
4003}
4004
4005#[cfg(feature = "tabled")]
4006impl tabled::Tabled for PatchLeaveRequestsLeaveRequestIdRequestBody {
4007 const LENGTH: usize = 9;
4008 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4009 vec![
4010 if let Some(requested_by) = &self.requested_by {
4011 format!("{:?}", requested_by).into()
4012 } else {
4013 String::new().into()
4014 },
4015 if let Some(status) = &self.status {
4016 format!("{:?}", status).into()
4017 } else {
4018 String::new().into()
4019 },
4020 if let Some(start_date) = &self.start_date {
4021 format!("{:?}", start_date).into()
4022 } else {
4023 String::new().into()
4024 },
4025 if let Some(end_date) = &self.end_date {
4026 format!("{:?}", end_date).into()
4027 } else {
4028 String::new().into()
4029 },
4030 if let Some(start_date_start_time) = &self.start_date_start_time {
4031 format!("{:?}", start_date_start_time).into()
4032 } else {
4033 String::new().into()
4034 },
4035 if let Some(end_date_end_time) = &self.end_date_end_time {
4036 format!("{:?}", end_date_end_time).into()
4037 } else {
4038 String::new().into()
4039 },
4040 if let Some(start_date_custom_hours) = &self.start_date_custom_hours {
4041 format!("{:?}", start_date_custom_hours).into()
4042 } else {
4043 String::new().into()
4044 },
4045 if let Some(end_date_custom_hours) = &self.end_date_custom_hours {
4046 format!("{:?}", end_date_custom_hours).into()
4047 } else {
4048 String::new().into()
4049 },
4050 if let Some(reason_for_leave) = &self.reason_for_leave {
4051 format!("{:?}", reason_for_leave).into()
4052 } else {
4053 String::new().into()
4054 },
4055 ]
4056 }
4057
4058 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4059 vec![
4060 "requested_by".into(),
4061 "status".into(),
4062 "start_date".into(),
4063 "end_date".into(),
4064 "start_date_start_time".into(),
4065 "end_date_end_time".into(),
4066 "start_date_custom_hours".into(),
4067 "end_date_custom_hours".into(),
4068 "reason_for_leave".into(),
4069 ]
4070 }
4071}
4072
4073#[derive(
4074 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4075)]
4076pub struct AppHandleId {
4077 #[serde(default, skip_serializing_if = "Option::is_none")]
4078 pub app_user_name: Option<String>,
4079}
4080
4081impl std::fmt::Display for AppHandleId {
4082 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4083 write!(
4084 f,
4085 "{}",
4086 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4087 )
4088 }
4089}
4090
4091#[cfg(feature = "tabled")]
4092impl tabled::Tabled for AppHandleId {
4093 const LENGTH: usize = 1;
4094 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4095 vec![if let Some(app_user_name) = &self.app_user_name {
4096 format!("{:?}", app_user_name).into()
4097 } else {
4098 String::new().into()
4099 }]
4100 }
4101
4102 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4103 vec!["app_user_name".into()]
4104 }
4105}
4106
4107#[derive(
4108 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4109)]
4110pub struct Results {
4111 #[serde(default, skip_serializing_if = "Option::is_none")]
4112 pub rippling_employee_id: Option<String>,
4113 #[serde(default, skip_serializing_if = "Option::is_none")]
4114 pub app_handle_id: Option<AppHandleId>,
4115}
4116
4117impl std::fmt::Display for Results {
4118 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4119 write!(
4120 f,
4121 "{}",
4122 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4123 )
4124 }
4125}
4126
4127#[cfg(feature = "tabled")]
4128impl tabled::Tabled for Results {
4129 const LENGTH: usize = 2;
4130 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4131 vec![
4132 if let Some(rippling_employee_id) = &self.rippling_employee_id {
4133 format!("{:?}", rippling_employee_id).into()
4134 } else {
4135 String::new().into()
4136 },
4137 if let Some(app_handle_id) = &self.app_handle_id {
4138 format!("{:?}", app_handle_id).into()
4139 } else {
4140 String::new().into()
4141 },
4142 ]
4143 }
4144
4145 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4146 vec!["rippling_employee_id".into(), "app_handle_id".into()]
4147 }
4148}
4149
4150#[derive(
4151 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4152)]
4153pub struct GetAppAppMatchingUsersResponse {
4154 #[serde(default, skip_serializing_if = "Option::is_none")]
4155 pub results: Option<Vec<Results>>,
4156}
4157
4158impl std::fmt::Display for GetAppAppMatchingUsersResponse {
4159 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4160 write!(
4161 f,
4162 "{}",
4163 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4164 )
4165 }
4166}
4167
4168#[cfg(feature = "tabled")]
4169impl tabled::Tabled for GetAppAppMatchingUsersResponse {
4170 const LENGTH: usize = 1;
4171 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4172 vec![if let Some(results) = &self.results {
4173 format!("{:?}", results).into()
4174 } else {
4175 String::new().into()
4176 }]
4177 }
4178
4179 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4180 vec!["results".into()]
4181 }
4182}
4183
4184#[doc = "PostMarkAppInstalledResponse."]
4185#[derive(
4186 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4187)]
4188pub struct PostMarkAppInstalledResponse {
4189 pub ok: bool,
4190}
4191
4192impl std::fmt::Display for PostMarkAppInstalledResponse {
4193 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4194 write!(
4195 f,
4196 "{}",
4197 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4198 )
4199 }
4200}
4201
4202#[cfg(feature = "tabled")]
4203impl tabled::Tabled for PostMarkAppInstalledResponse {
4204 const LENGTH: usize = 1;
4205 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4206 vec![format!("{:?}", self.ok).into()]
4207 }
4208
4209 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4210 vec!["ok".into()]
4211 }
4212}