#![doc = r" This module contains the generated types for the library."] use tabled::Tabled; pub mod base64 { #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"] #![doc = " base64 implementations to account for various clients and libraries. Compatible"] #![doc = " with serde and JsonSchema."] use serde::de::{Error, Unexpected, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::convert::TryFrom; use std::fmt; static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[ data_encoding::BASE64, data_encoding::BASE64URL, data_encoding::BASE64URL_NOPAD, data_encoding::BASE64_MIME, data_encoding::BASE64_NOPAD, ]; #[derive(Debug, Clone, PartialEq, Eq)] #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"] #[doc = " when deserializing, will decode from many different types of base64 possible."] pub struct Base64Data(pub Vec); impl Base64Data { #[doc = " Return is the data is empty."] pub fn is_empty(&self) -> bool { self.0.is_empty() } } impl fmt::Display for Base64Data { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0)) } } impl From for Vec { fn from(data: Base64Data) -> Vec { data.0 } } impl From> for Base64Data { fn from(data: Vec) -> Base64Data { Base64Data(data) } } impl AsRef<[u8]> for Base64Data { fn as_ref(&self) -> &[u8] { &self.0 } } impl TryFrom<&str> for Base64Data { type Error = anyhow::Error; fn try_from(v: &str) -> Result { for config in ALLOWED_DECODING_FORMATS { if let Ok(data) = config.decode(v.as_bytes()) { return Ok(Base64Data(data)); } } anyhow::bail!("Could not decode base64 data: {}", v); } } struct Base64DataVisitor; impl<'de> Visitor<'de> for Base64DataVisitor { type Value = Base64Data; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!(formatter, "a base64 encoded string") } fn visit_str(self, v: &str) -> Result where E: Error, { for config in ALLOWED_DECODING_FORMATS { if let Ok(data) = config.decode(v.as_bytes()) { return Ok(Base64Data(data)); } } Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self)) } } impl<'de> Deserialize<'de> for Base64Data { fn deserialize(deserializer: D) -> Result>::Error> where D: Deserializer<'de>, { deserializer.deserialize_str(Base64DataVisitor) } } impl Serialize for Base64Data { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0); serializer.serialize_str(&encoded) } } impl schemars::JsonSchema for Base64Data { fn schema_name() -> String { "Base64Data".to_string() } fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { let mut obj = gen.root_schema_for::().schema; obj.format = Some("byte".to_string()); schemars::schema::Schema::Object(obj) } fn is_referenceable() -> bool { false } } #[cfg(test)] mod tests { use super::Base64Data; use std::convert::TryFrom; #[test] fn test_base64_try_from() { assert!(Base64Data::try_from("aGVsbG8=").is_ok()); assert!(Base64Data::try_from("abcdefghij").is_err()); } } } pub mod paginate { #![doc = " Utility functions used for pagination."] use anyhow::Result; #[doc = " A trait for types that allow pagination."] pub trait Pagination { #[doc = " The item that is paginated."] type Item: serde::de::DeserializeOwned; #[doc = " Returns true if the response has more pages."] fn has_more_pages(&self) -> bool; #[doc = " Modify a request to get the next page."] fn next_page( &self, req: reqwest::Request, ) -> Result; #[doc = " Get the items from a page."] fn items(&self) -> Vec; } } pub mod phone_number { #![doc = " A library to implement phone numbers for our database and JSON serialization and deserialization."] use schemars::JsonSchema; use std::str::FromStr; #[doc = " A phone number."] #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)] pub struct PhoneNumber(pub Option); impl From for PhoneNumber { fn from(id: phonenumber::PhoneNumber) -> PhoneNumber { PhoneNumber(Some(id)) } } impl AsRef> for PhoneNumber { fn as_ref(&self) -> &Option { &self.0 } } impl std::ops::Deref for PhoneNumber { type Target = Option; fn deref(&self) -> &Self::Target { &self.0 } } impl serde::ser::Serialize for PhoneNumber { fn serialize(&self, serializer: S) -> Result where S: serde::ser::Serializer, { serializer.serialize_str(&self.to_string()) } } impl<'de> serde::de::Deserialize<'de> for PhoneNumber { fn deserialize(deserializer: D) -> Result where D: serde::de::Deserializer<'de>, { let s = String::deserialize(deserializer).unwrap_or_default(); PhoneNumber::from_str(&s).map_err(serde::de::Error::custom) } } impl std::str::FromStr for PhoneNumber { type Err = anyhow::Error; fn from_str(s: &str) -> Result { if s.trim().is_empty() { return Ok(PhoneNumber(None)); } let s = if !s.trim().starts_with('+') { format!("+1{}", s) .replace('-', "") .replace('(', "") .replace(')', "") .replace(' ', "") } else { s.replace('-', "") .replace('(', "") .replace(')', "") .replace(' ', "") }; Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err( |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e), )?))) } } impl std::fmt::Display for PhoneNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = if let Some(phone) = &self.0 { phone .format() .mode(phonenumber::Mode::International) .to_string() } else { String::new() }; write!(f, "{}", s) } } impl JsonSchema for PhoneNumber { fn schema_name() -> String { "PhoneNumber".to_string() } fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { let mut obj = gen.root_schema_for::().schema; obj.format = Some("phone".to_string()); schemars::schema::Schema::Object(obj) } fn is_referenceable() -> bool { false } } #[cfg(test)] mod test { use super::PhoneNumber; use pretty_assertions::assert_eq; #[test] fn test_parse_phone_number() { let mut phone = "+1-555-555-5555"; let mut phone_parsed: PhoneNumber = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); assert_eq!(phone_parsed, expected); let mut expected_str = "+1 555-555-5555"; assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = "555-555-5555"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); assert_eq!(phone_parsed, expected); assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = "+1 555-555-5555"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); assert_eq!(phone_parsed, expected); assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = "5555555555"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); assert_eq!(phone_parsed, expected); assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = "(510) 864-1234"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap())); assert_eq!(phone_parsed, expected); expected_str = "+1 510-864-1234"; assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = "(510)8641234"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); assert_eq!(phone_parsed, expected); expected_str = "+1 510-864-1234"; assert_eq!(expected_str, serde_json::json!(phone_parsed)); phone = ""; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); assert_eq!(phone_parsed, PhoneNumber(None)); assert_eq!("", serde_json::json!(phone_parsed)); phone = "+49 30 1234 1234"; phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); assert_eq!(phone_parsed, expected); expected_str = "+49 30 12341234"; assert_eq!(expected_str, serde_json::json!(phone_parsed)); } } } pub mod error { #![doc = " Error methods."] #[doc = " Error produced by generated client methods."] pub enum Error { #[doc = " The request did not conform to API requirements."] InvalidRequest(String), #[doc = " A server error either due to the data, or with the connection."] CommunicationError(reqwest::Error), #[doc = " An expected response whose deserialization failed."] SerdeError { #[doc = " The error."] error: format_serde_error::SerdeError, #[doc = " The response status."] status: reqwest::StatusCode, }, #[doc = " An expected error response."] InvalidResponsePayload { #[doc = " The error."] error: reqwest::Error, #[doc = " The full response."] response: reqwest::Response, }, #[doc = " A response not listed in the API description. This may represent a"] #[doc = " success or failure response; check `status().is_success()`."] UnexpectedResponse(reqwest::Response), } impl Error { #[doc = " Returns the status code, if the error was generated from a response."] pub fn status(&self) -> Option { match self { Error::InvalidRequest(_) => None, Error::CommunicationError(e) => e.status(), Error::SerdeError { error: _, status } => Some(*status), Error::InvalidResponsePayload { error: _, response } => Some(response.status()), Error::UnexpectedResponse(r) => Some(r.status()), } } #[doc = " Creates a new error from a response status and a serde error."] pub fn from_serde_error( e: format_serde_error::SerdeError, status: reqwest::StatusCode, ) -> Self { Self::SerdeError { error: e, status } } } impl From for Error { fn from(e: reqwest::Error) -> Self { Self::CommunicationError(e) } } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Error::InvalidRequest(s) => { write!(f, "Invalid Request: {}", s) } Error::CommunicationError(e) => { write!(f, "Communication Error: {}", e) } Error::SerdeError { error, status: _ } => { write!(f, "Serde Error: {}", error) } Error::InvalidResponsePayload { error, response: _ } => { write!(f, "Invalid Response Payload: {}", error) } Error::UnexpectedResponse(r) => { write!(f, "Unexpected Response: {:?}", r) } } } } trait ErrorFormat { fn fmt_info(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result; } impl std::fmt::Debug for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self, f) } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { Error::CommunicationError(e) => Some(e), Error::SerdeError { error, status: _ } => Some(error), Error::InvalidResponsePayload { error, response: _ } => Some(error), _ => None, } } } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Root { pub current_user_url: String, pub current_user_authorizations_html_url: String, pub authorizations_url: String, pub code_search_url: String, pub commit_search_url: String, pub emails_url: String, pub emojis_url: String, pub events_url: String, pub feeds_url: String, pub followers_url: String, pub following_url: String, pub gists_url: String, pub hub_url: String, pub issue_search_url: String, pub issues_url: String, pub keys_url: String, pub label_search_url: String, pub notifications_url: String, pub organization_url: String, pub organization_repositories_url: String, pub organization_teams_url: String, pub public_gists_url: String, pub rate_limit_url: String, pub repository_url: String, pub repository_search_url: String, pub current_user_repositories_url: String, pub starred_url: String, pub starred_gists_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub topic_search_url: Option, pub user_url: String, pub user_organizations_url: String, pub user_repositories_url: String, pub user_search_url: String, } impl std::fmt::Display for Root { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Root { const LENGTH: usize = 33; fn fields(&self) -> Vec { vec![ self.current_user_url.clone(), self.current_user_authorizations_html_url.clone(), self.authorizations_url.clone(), self.code_search_url.clone(), self.commit_search_url.clone(), self.emails_url.clone(), self.emojis_url.clone(), self.events_url.clone(), self.feeds_url.clone(), self.followers_url.clone(), self.following_url.clone(), self.gists_url.clone(), self.hub_url.clone(), self.issue_search_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.label_search_url.clone(), self.notifications_url.clone(), self.organization_url.clone(), self.organization_repositories_url.clone(), self.organization_teams_url.clone(), self.public_gists_url.clone(), self.rate_limit_url.clone(), self.repository_url.clone(), self.repository_search_url.clone(), self.current_user_repositories_url.clone(), self.starred_url.clone(), self.starred_gists_url.clone(), if let Some(topic_search_url) = &self.topic_search_url { format!("{:?}", topic_search_url) } else { String::new() }, self.user_url.clone(), self.user_organizations_url.clone(), self.user_repositories_url.clone(), self.user_search_url.clone(), ] } fn headers() -> Vec { vec![ "current_user_url".to_string(), "current_user_authorizations_html_url".to_string(), "authorizations_url".to_string(), "code_search_url".to_string(), "commit_search_url".to_string(), "emails_url".to_string(), "emojis_url".to_string(), "events_url".to_string(), "feeds_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "hub_url".to_string(), "issue_search_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "label_search_url".to_string(), "notifications_url".to_string(), "organization_url".to_string(), "organization_repositories_url".to_string(), "organization_teams_url".to_string(), "public_gists_url".to_string(), "rate_limit_url".to_string(), "repository_url".to_string(), "repository_search_url".to_string(), "current_user_repositories_url".to_string(), "starred_url".to_string(), "starred_gists_url".to_string(), "topic_search_url".to_string(), "user_url".to_string(), "user_organizations_url".to_string(), "user_repositories_url".to_string(), "user_search_url".to_string(), ] } } #[doc = "Simple User"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableSimpleUser { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, pub login: String, pub id: i64, pub node_id: String, pub avatar_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub html_url: url::Url, pub followers_url: url::Url, pub following_url: String, pub gists_url: String, pub starred_url: String, pub subscriptions_url: url::Url, pub organizations_url: url::Url, pub repos_url: url::Url, pub events_url: String, pub received_events_url: url::Url, #[serde(rename = "type")] pub type_: String, pub site_admin: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub starred_at: Option, } impl std::fmt::Display for NullableSimpleUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableSimpleUser { const LENGTH: usize = 21; fn fields(&self) -> Vec { vec![ if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, self.login.clone(), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.followers_url), self.following_url.clone(), self.gists_url.clone(), self.starred_url.clone(), format!("{:?}", self.subscriptions_url), format!("{:?}", self.organizations_url), format!("{:?}", self.repos_url), self.events_url.clone(), format!("{:?}", self.received_events_url), self.type_.clone(), format!("{:?}", self.site_admin), if let Some(starred_at) = &self.starred_at { format!("{:?}", starred_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "email".to_string(), "login".to_string(), "id".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "starred_at".to_string(), ] } } #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Integration { #[doc = "Unique identifier of the GitHub app"] pub id: i64, #[doc = "The slug name of the GitHub app"] #[serde(default, skip_serializing_if = "Option::is_none")] pub slug: Option, pub node_id: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[doc = "The name of the GitHub app"] pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub external_url: url::Url, pub html_url: url::Url, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "The set of permissions for the GitHub app"] pub permissions: Permissions, #[doc = "The list of events for the GitHub app"] pub events: Vec, #[doc = "The number of installations associated with the GitHub app"] #[serde(default, skip_serializing_if = "Option::is_none")] pub installations_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub client_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub webhook_secret: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pem: Option, } impl std::fmt::Display for Integration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Integration { const LENGTH: usize = 17; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), if let Some(slug) = &self.slug { format!("{:?}", slug) } else { String::new() }, self.node_id.clone(), format!("{:?}", self.owner), self.name.clone(), format!("{:?}", self.description), format!("{:?}", self.external_url), format!("{:?}", self.html_url), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.permissions), format!("{:?}", self.events), if let Some(installations_count) = &self.installations_count { format!("{:?}", installations_count) } else { String::new() }, if let Some(client_id) = &self.client_id { format!("{:?}", client_id) } else { String::new() }, if let Some(client_secret) = &self.client_secret { format!("{:?}", client_secret) } else { String::new() }, if let Some(webhook_secret) = &self.webhook_secret { format!("{:?}", webhook_secret) } else { String::new() }, if let Some(pem) = &self.pem { format!("{:?}", pem) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "slug".to_string(), "node_id".to_string(), "owner".to_string(), "name".to_string(), "description".to_string(), "external_url".to_string(), "html_url".to_string(), "created_at".to_string(), "updated_at".to_string(), "permissions".to_string(), "events".to_string(), "installations_count".to_string(), "client_id".to_string(), "client_secret".to_string(), "webhook_secret".to_string(), "pem".to_string(), ] } } #[doc = "Basic Error"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BasicError { #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub documentation_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, } impl std::fmt::Display for BasicError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BasicError { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ if let Some(message) = &self.message { format!("{:?}", message) } else { String::new() }, if let Some(documentation_url) = &self.documentation_url { format!("{:?}", documentation_url) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(status) = &self.status { format!("{:?}", status) } else { String::new() }, ] } fn headers() -> Vec { vec![ "message".to_string(), "documentation_url".to_string(), "url".to_string(), "status".to_string(), ] } } #[doc = "Validation Error Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ValidationErrorSimple { pub message: String, pub documentation_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub errors: Option>, } impl std::fmt::Display for ValidationErrorSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ValidationErrorSimple { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.message.clone(), self.documentation_url.clone(), if let Some(errors) = &self.errors { format!("{:?}", errors) } else { String::new() }, ] } fn headers() -> Vec { vec![ "message".to_string(), "documentation_url".to_string(), "errors".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, )] pub enum WebhookConfigInsecureSsl { String(String), f64(f64), } #[doc = "Configuration object of the webhook"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct WebhookConfig { #[doc = "The URL to which the payloads will be delivered."] #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[doc = "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub content_type: Option, #[doc = "If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub secret: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub insecure_ssl: Option, } impl std::fmt::Display for WebhookConfig { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for WebhookConfig { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(content_type) = &self.content_type { format!("{:?}", content_type) } else { String::new() }, if let Some(secret) = &self.secret { format!("{:?}", secret) } else { String::new() }, if let Some(insecure_ssl) = &self.insecure_ssl { format!("{:?}", insecure_ssl) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "content_type".to_string(), "secret".to_string(), "insecure_ssl".to_string(), ] } } #[doc = "Delivery made by a webhook, without request and response information."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct HookDeliveryItem { #[doc = "Unique identifier of the webhook delivery."] pub id: i64, #[doc = "Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event)."] pub guid: String, #[doc = "Time when the webhook delivery occurred."] pub delivered_at: chrono::DateTime, #[doc = "Whether the webhook delivery is a redelivery."] pub redelivery: bool, #[doc = "Time spent delivering."] pub duration: f64, #[doc = "Describes the response returned after attempting the delivery."] pub status: String, #[doc = "Status code received when delivery was made."] pub status_code: i64, #[doc = "The event that triggered the delivery."] pub event: String, #[doc = "The type of activity for the event that triggered the delivery."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, #[doc = "The id of the GitHub App installation associated with this event."] #[serde(default, skip_serializing_if = "Option::is_none")] pub installation_id: Option, #[doc = "The id of the repository associated with this event."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_id: Option, } impl std::fmt::Display for HookDeliveryItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for HookDeliveryItem { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.guid.clone(), format!("{:?}", self.delivered_at), format!("{:?}", self.redelivery), format!("{:?}", self.duration), self.status.clone(), format!("{:?}", self.status_code), self.event.clone(), format!("{:?}", self.action), format!("{:?}", self.installation_id), format!("{:?}", self.repository_id), ] } fn headers() -> Vec { vec![ "id".to_string(), "guid".to_string(), "delivered_at".to_string(), "redelivery".to_string(), "duration".to_string(), "status".to_string(), "status_code".to_string(), "event".to_string(), "action".to_string(), "installation_id".to_string(), "repository_id".to_string(), ] } } #[doc = "Scim Error"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ScimError { #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub documentation_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub detail: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, #[serde(rename = "scimType", default, skip_serializing_if = "Option::is_none")] pub scim_type: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub schemas: Option>, } impl std::fmt::Display for ScimError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ScimError { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ if let Some(message) = &self.message { format!("{:?}", message) } else { String::new() }, if let Some(documentation_url) = &self.documentation_url { format!("{:?}", documentation_url) } else { String::new() }, if let Some(detail) = &self.detail { format!("{:?}", detail) } else { String::new() }, if let Some(status) = &self.status { format!("{:?}", status) } else { String::new() }, if let Some(scim_type) = &self.scim_type { format!("{:?}", scim_type) } else { String::new() }, if let Some(schemas) = &self.schemas { format!("{:?}", schemas) } else { String::new() }, ] } fn headers() -> Vec { vec![ "message".to_string(), "documentation_url".to_string(), "detail".to_string(), "status".to_string(), "scim_type".to_string(), "schemas".to_string(), ] } } #[doc = "Validation Error"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ValidationError { pub message: String, pub documentation_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub errors: Option>, } impl std::fmt::Display for ValidationError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ValidationError { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.message.clone(), self.documentation_url.clone(), if let Some(errors) = &self.errors { format!("{:?}", errors) } else { String::new() }, ] } fn headers() -> Vec { vec![ "message".to_string(), "documentation_url".to_string(), "errors".to_string(), ] } } #[doc = "Delivery made by a webhook."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct HookDelivery { #[doc = "Unique identifier of the delivery."] pub id: i64, #[doc = "Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event)."] pub guid: String, #[doc = "Time when the delivery was delivered."] pub delivered_at: chrono::DateTime, #[doc = "Whether the delivery is a redelivery."] pub redelivery: bool, #[doc = "Time spent delivering."] pub duration: f64, #[doc = "Description of the status of the attempted delivery"] pub status: String, #[doc = "Status code received when delivery was made."] pub status_code: i64, #[doc = "The event that triggered the delivery."] pub event: String, #[doc = "The type of activity for the event that triggered the delivery."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, #[doc = "The id of the GitHub App installation associated with this event."] #[serde(default, skip_serializing_if = "Option::is_none")] pub installation_id: Option, #[doc = "The id of the repository associated with this event."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_id: Option, #[doc = "The URL target of the delivery."] #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, pub request: Request, pub response: Response, } impl std::fmt::Display for HookDelivery { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for HookDelivery { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.guid.clone(), format!("{:?}", self.delivered_at), format!("{:?}", self.redelivery), format!("{:?}", self.duration), self.status.clone(), format!("{:?}", self.status_code), self.event.clone(), format!("{:?}", self.action), format!("{:?}", self.installation_id), format!("{:?}", self.repository_id), if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, format!("{:?}", self.request), format!("{:?}", self.response), ] } fn headers() -> Vec { vec![ "id".to_string(), "guid".to_string(), "delivered_at".to_string(), "redelivery".to_string(), "duration".to_string(), "status".to_string(), "status_code".to_string(), "event".to_string(), "action".to_string(), "installation_id".to_string(), "repository_id".to_string(), "url".to_string(), "request".to_string(), "response".to_string(), ] } } #[doc = "Simple User"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SimpleUser { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, pub login: String, pub id: i64, pub node_id: String, pub avatar_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub html_url: url::Url, pub followers_url: url::Url, pub following_url: String, pub gists_url: String, pub starred_url: String, pub subscriptions_url: url::Url, pub organizations_url: url::Url, pub repos_url: url::Url, pub events_url: String, pub received_events_url: url::Url, #[serde(rename = "type")] pub type_: String, pub site_admin: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub starred_at: Option, } impl std::fmt::Display for SimpleUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SimpleUser { const LENGTH: usize = 21; fn fields(&self) -> Vec { vec![ if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, self.login.clone(), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.followers_url), self.following_url.clone(), self.gists_url.clone(), self.starred_url.clone(), format!("{:?}", self.subscriptions_url), format!("{:?}", self.organizations_url), format!("{:?}", self.repos_url), self.events_url.clone(), format!("{:?}", self.received_events_url), self.type_.clone(), format!("{:?}", self.site_admin), if let Some(starred_at) = &self.starred_at { format!("{:?}", starred_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "email".to_string(), "login".to_string(), "id".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "starred_at".to_string(), ] } } #[doc = "An enterprise account"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Enterprise { #[doc = "A short description of the enterprise."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub html_url: url::Url, #[doc = "The enterprise's website URL."] #[serde(default, skip_serializing_if = "Option::is_none")] pub website_url: Option, #[doc = "Unique identifier of the enterprise"] pub id: i64, pub node_id: String, #[doc = "The name of the enterprise."] pub name: String, #[doc = "The slug url identifier for the enterprise."] pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, pub avatar_url: url::Url, } impl std::fmt::Display for Enterprise { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Enterprise { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ if let Some(description) = &self.description { format!("{:?}", description) } else { String::new() }, format!("{:?}", self.html_url), if let Some(website_url) = &self.website_url { format!("{:?}", website_url) } else { String::new() }, format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.slug.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.avatar_url), ] } fn headers() -> Vec { vec![ "description".to_string(), "html_url".to_string(), "website_url".to_string(), "id".to_string(), "node_id".to_string(), "name".to_string(), "slug".to_string(), "created_at".to_string(), "updated_at".to_string(), "avatar_url".to_string(), ] } } #[doc = "The permissions granted to the user-to-server access token."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AppPermissions { #[doc = "The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts."] #[serde(default, skip_serializing_if = "Option::is_none")] pub actions: Option, #[doc = "The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub administration: Option, #[doc = "The level of permission to grant the access token for checks on code."] #[serde(default, skip_serializing_if = "Option::is_none")] pub checks: Option, #[doc = "The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges."] #[serde(default, skip_serializing_if = "Option::is_none")] pub contents: Option, #[doc = "The level of permission to grant the access token for deployments and deployment statuses."] #[serde(default, skip_serializing_if = "Option::is_none")] pub deployments: Option, #[doc = "The level of permission to grant the access token for managing repository environments."] #[serde(default, skip_serializing_if = "Option::is_none")] pub environments: Option, #[doc = "The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones."] #[serde(default, skip_serializing_if = "Option::is_none")] pub issues: Option, #[doc = "The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata."] #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option, #[doc = "The level of permission to grant the access token for packages published to GitHub Packages."] #[serde(default, skip_serializing_if = "Option::is_none")] pub packages: Option, #[doc = "The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pages: Option, #[doc = "The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pull_requests: Option, #[doc = "The level of permission to grant the access token to manage the post-receive hooks for a repository."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_hooks: Option, #[doc = "The level of permission to grant the access token to manage repository projects, columns, and cards."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_projects: Option, #[doc = "The level of permission to grant the access token to view and manage secret scanning alerts."] #[serde(default, skip_serializing_if = "Option::is_none")] pub secret_scanning_alerts: Option, #[doc = "The level of permission to grant the access token to manage repository secrets."] #[serde(default, skip_serializing_if = "Option::is_none")] pub secrets: Option, #[doc = "The level of permission to grant the access token to view and manage security events like code scanning alerts."] #[serde(default, skip_serializing_if = "Option::is_none")] pub security_events: Option, #[doc = "The level of permission to grant the access token to manage just a single file."] #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file: Option, #[doc = "The level of permission to grant the access token for commit statuses."] #[serde(default, skip_serializing_if = "Option::is_none")] pub statuses: Option, #[doc = "The level of permission to grant the access token to manage Dependabot alerts."] #[serde(default, skip_serializing_if = "Option::is_none")] pub vulnerability_alerts: Option, #[doc = "The level of permission to grant the access token to update GitHub Actions workflow files."] #[serde(default, skip_serializing_if = "Option::is_none")] pub workflows: Option, #[doc = "The level of permission to grant the access token for organization teams and members."] #[serde(default, skip_serializing_if = "Option::is_none")] pub members: Option, #[doc = "The level of permission to grant the access token to manage access to an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_administration: Option, #[doc = "The level of permission to grant the access token to manage the post-receive hooks for an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_hooks: Option, #[doc = "The level of permission to grant the access token for viewing an organization's plan."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_plan: Option, #[doc = "The level of permission to grant the access token to manage organization projects and projects beta (where available)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_projects: Option, #[doc = "The level of permission to grant the access token for organization packages published to GitHub Packages."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_packages: Option, #[doc = "The level of permission to grant the access token to manage organization secrets."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_secrets: Option, #[doc = "The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_self_hosted_runners: Option, #[doc = "The level of permission to grant the access token to view and manage users blocked by the organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_user_blocking: Option, #[doc = "The level of permission to grant the access token to manage team discussions and related comments."] #[serde(default, skip_serializing_if = "Option::is_none")] pub team_discussions: Option, } impl std::fmt::Display for AppPermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AppPermissions { const LENGTH: usize = 30; fn fields(&self) -> Vec { vec![ if let Some(actions) = &self.actions { format!("{:?}", actions) } else { String::new() }, if let Some(administration) = &self.administration { format!("{:?}", administration) } else { String::new() }, if let Some(checks) = &self.checks { format!("{:?}", checks) } else { String::new() }, if let Some(contents) = &self.contents { format!("{:?}", contents) } else { String::new() }, if let Some(deployments) = &self.deployments { format!("{:?}", deployments) } else { String::new() }, if let Some(environments) = &self.environments { format!("{:?}", environments) } else { String::new() }, if let Some(issues) = &self.issues { format!("{:?}", issues) } else { String::new() }, if let Some(metadata) = &self.metadata { format!("{:?}", metadata) } else { String::new() }, if let Some(packages) = &self.packages { format!("{:?}", packages) } else { String::new() }, if let Some(pages) = &self.pages { format!("{:?}", pages) } else { String::new() }, if let Some(pull_requests) = &self.pull_requests { format!("{:?}", pull_requests) } else { String::new() }, if let Some(repository_hooks) = &self.repository_hooks { format!("{:?}", repository_hooks) } else { String::new() }, if let Some(repository_projects) = &self.repository_projects { format!("{:?}", repository_projects) } else { String::new() }, if let Some(secret_scanning_alerts) = &self.secret_scanning_alerts { format!("{:?}", secret_scanning_alerts) } else { String::new() }, if let Some(secrets) = &self.secrets { format!("{:?}", secrets) } else { String::new() }, if let Some(security_events) = &self.security_events { format!("{:?}", security_events) } else { String::new() }, if let Some(single_file) = &self.single_file { format!("{:?}", single_file) } else { String::new() }, if let Some(statuses) = &self.statuses { format!("{:?}", statuses) } else { String::new() }, if let Some(vulnerability_alerts) = &self.vulnerability_alerts { format!("{:?}", vulnerability_alerts) } else { String::new() }, if let Some(workflows) = &self.workflows { format!("{:?}", workflows) } else { String::new() }, if let Some(members) = &self.members { format!("{:?}", members) } else { String::new() }, if let Some(organization_administration) = &self.organization_administration { format!("{:?}", organization_administration) } else { String::new() }, if let Some(organization_hooks) = &self.organization_hooks { format!("{:?}", organization_hooks) } else { String::new() }, if let Some(organization_plan) = &self.organization_plan { format!("{:?}", organization_plan) } else { String::new() }, if let Some(organization_projects) = &self.organization_projects { format!("{:?}", organization_projects) } else { String::new() }, if let Some(organization_packages) = &self.organization_packages { format!("{:?}", organization_packages) } else { String::new() }, if let Some(organization_secrets) = &self.organization_secrets { format!("{:?}", organization_secrets) } else { String::new() }, if let Some(organization_self_hosted_runners) = &self.organization_self_hosted_runners { format!("{:?}", organization_self_hosted_runners) } else { String::new() }, if let Some(organization_user_blocking) = &self.organization_user_blocking { format!("{:?}", organization_user_blocking) } else { String::new() }, if let Some(team_discussions) = &self.team_discussions { format!("{:?}", team_discussions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "actions".to_string(), "administration".to_string(), "checks".to_string(), "contents".to_string(), "deployments".to_string(), "environments".to_string(), "issues".to_string(), "metadata".to_string(), "packages".to_string(), "pages".to_string(), "pull_requests".to_string(), "repository_hooks".to_string(), "repository_projects".to_string(), "secret_scanning_alerts".to_string(), "secrets".to_string(), "security_events".to_string(), "single_file".to_string(), "statuses".to_string(), "vulnerability_alerts".to_string(), "workflows".to_string(), "members".to_string(), "organization_administration".to_string(), "organization_hooks".to_string(), "organization_plan".to_string(), "organization_projects".to_string(), "organization_packages".to_string(), "organization_secrets".to_string(), "organization_self_hosted_runners".to_string(), "organization_user_blocking".to_string(), "team_discussions".to_string(), ] } } #[doc = "Installation"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Installation { #[doc = "The ID of the installation."] pub id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub account: Option, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: RepositorySelection, pub access_tokens_url: url::Url, pub repositories_url: url::Url, pub html_url: url::Url, pub app_id: i64, #[doc = "The ID of the user or organization this token is being scoped to."] pub target_id: i64, pub target_type: String, #[doc = "The permissions granted to the user-to-server access token."] pub permissions: AppPermissions, pub events: Vec, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_multiple_single_files: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file_paths: Option>, pub app_slug: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub suspended_by: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub suspended_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub contact_email: Option, } impl std::fmt::Display for Installation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Installation { const LENGTH: usize = 20; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.account), format!("{:?}", self.repository_selection), format!("{:?}", self.access_tokens_url), format!("{:?}", self.repositories_url), format!("{:?}", self.html_url), format!("{:?}", self.app_id), format!("{:?}", self.target_id), self.target_type.clone(), format!("{:?}", self.permissions), format!("{:?}", self.events), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.single_file_name), if let Some(has_multiple_single_files) = &self.has_multiple_single_files { format!("{:?}", has_multiple_single_files) } else { String::new() }, if let Some(single_file_paths) = &self.single_file_paths { format!("{:?}", single_file_paths) } else { String::new() }, self.app_slug.clone(), format!("{:?}", self.suspended_by), format!("{:?}", self.suspended_at), if let Some(contact_email) = &self.contact_email { format!("{:?}", contact_email) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "account".to_string(), "repository_selection".to_string(), "access_tokens_url".to_string(), "repositories_url".to_string(), "html_url".to_string(), "app_id".to_string(), "target_id".to_string(), "target_type".to_string(), "permissions".to_string(), "events".to_string(), "created_at".to_string(), "updated_at".to_string(), "single_file_name".to_string(), "has_multiple_single_files".to_string(), "single_file_paths".to_string(), "app_slug".to_string(), "suspended_by".to_string(), "suspended_at".to_string(), "contact_email".to_string(), ] } } #[doc = "License Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableLicenseSimple { pub key: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub spdx_id: Option, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for NullableLicenseSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableLicenseSimple { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.key.clone(), self.name.clone(), format!("{:?}", self.url), format!("{:?}", self.spdx_id), self.node_id.clone(), if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "key".to_string(), "name".to_string(), "url".to_string(), "spdx_id".to_string(), "node_id".to_string(), "html_url".to_string(), ] } } #[doc = "A git repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Repository { #[doc = "Unique identifier of the repository"] pub id: i64, pub node_id: String, #[doc = "The name of the repository."] pub name: String, pub full_name: String, #[doc = "License Simple"] #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization: Option, pub forks: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[doc = "Simple User"] pub owner: SimpleUser, #[doc = "Whether the repository is private or public."] pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, pub git_url: String, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, pub ssh_url: String, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, pub clone_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, pub svn_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, pub forks_count: i64, pub stargazers_count: i64, pub watchers_count: i64, pub size: i64, #[doc = "The default branch of the repository."] pub default_branch: String, pub open_issues_count: i64, #[doc = "Whether this repository acts as a template that can be used to generate new repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, #[doc = "Whether issues are enabled."] pub has_issues: bool, #[doc = "Whether projects are enabled."] pub has_projects: bool, #[doc = "Whether the wiki is enabled."] pub has_wiki: bool, pub has_pages: bool, #[doc = "Whether downloads are enabled."] pub has_downloads: bool, #[doc = "Whether the repository is archived."] pub archived: bool, #[doc = "Returns whether or not this repository disabled."] pub disabled: bool, #[doc = "The repository visibility: public, private, or internal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "Whether to allow rebase merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_rebase_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[doc = "Whether to allow squash merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_squash_merge: Option, #[doc = "Whether to allow Auto-merge to be used on pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_auto_merge: Option, #[doc = "Whether to delete head branches when pull requests are merged"] #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[doc = "Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_update_branch: Option, #[doc = "Whether a squash merge commit can use the pull request title as default."] #[serde(default, skip_serializing_if = "Option::is_none")] pub use_squash_pr_title_as_default: Option, #[doc = "Whether to allow merge commits for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_merge_commit: Option, #[doc = "Whether to allow forking this repo"] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscribers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub network_count: Option, pub open_issues: i64, pub watchers: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub master_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub starred_at: Option, } impl std::fmt::Display for Repository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Repository { const LENGTH: usize = 92; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.license), if let Some(organization) = &self.organization { format!("{:?}", organization) } else { String::new() }, format!("{:?}", self.forks), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), self.git_url.clone(), self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), self.ssh_url.clone(), format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), self.clone_url.clone(), format!("{:?}", self.mirror_url), format!("{:?}", self.hooks_url), format!("{:?}", self.svn_url), format!("{:?}", self.homepage), format!("{:?}", self.language), format!("{:?}", self.forks_count), format!("{:?}", self.stargazers_count), format!("{:?}", self.watchers_count), format!("{:?}", self.size), self.default_branch.clone(), format!("{:?}", self.open_issues_count), if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, format!("{:?}", self.has_issues), format!("{:?}", self.has_projects), format!("{:?}", self.has_wiki), format!("{:?}", self.has_pages), format!("{:?}", self.has_downloads), format!("{:?}", self.archived), format!("{:?}", self.disabled), if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, format!("{:?}", self.pushed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(allow_rebase_merge) = &self.allow_rebase_merge { format!("{:?}", allow_rebase_merge) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(allow_squash_merge) = &self.allow_squash_merge { format!("{:?}", allow_squash_merge) } else { String::new() }, if let Some(allow_auto_merge) = &self.allow_auto_merge { format!("{:?}", allow_auto_merge) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(allow_update_branch) = &self.allow_update_branch { format!("{:?}", allow_update_branch) } else { String::new() }, if let Some(use_squash_pr_title_as_default) = &self.use_squash_pr_title_as_default { format!("{:?}", use_squash_pr_title_as_default) } else { String::new() }, if let Some(allow_merge_commit) = &self.allow_merge_commit { format!("{:?}", allow_merge_commit) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, if let Some(subscribers_count) = &self.subscribers_count { format!("{:?}", subscribers_count) } else { String::new() }, if let Some(network_count) = &self.network_count { format!("{:?}", network_count) } else { String::new() }, format!("{:?}", self.open_issues), format!("{:?}", self.watchers), if let Some(master_branch) = &self.master_branch { format!("{:?}", master_branch) } else { String::new() }, if let Some(starred_at) = &self.starred_at { format!("{:?}", starred_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "license".to_string(), "organization".to_string(), "forks".to_string(), "permissions".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "allow_rebase_merge".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "allow_squash_merge".to_string(), "allow_auto_merge".to_string(), "delete_branch_on_merge".to_string(), "allow_update_branch".to_string(), "use_squash_pr_title_as_default".to_string(), "allow_merge_commit".to_string(), "allow_forking".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "open_issues".to_string(), "watchers".to_string(), "master_branch".to_string(), "starred_at".to_string(), ] } } #[doc = "Authentication token for a GitHub App installed on a user or org."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct InstallationToken { pub token: String, pub expires_at: String, #[doc = "The permissions granted to the user-to-server access token."] #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_selection: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub repositories: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_multiple_single_files: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file_paths: Option>, } impl std::fmt::Display for InstallationToken { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for InstallationToken { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ self.token.clone(), self.expires_at.clone(), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(repository_selection) = &self.repository_selection { format!("{:?}", repository_selection) } else { String::new() }, if let Some(repositories) = &self.repositories { format!("{:?}", repositories) } else { String::new() }, if let Some(single_file) = &self.single_file { format!("{:?}", single_file) } else { String::new() }, if let Some(has_multiple_single_files) = &self.has_multiple_single_files { format!("{:?}", has_multiple_single_files) } else { String::new() }, if let Some(single_file_paths) = &self.single_file_paths { format!("{:?}", single_file_paths) } else { String::new() }, ] } fn headers() -> Vec { vec![ "token".to_string(), "expires_at".to_string(), "permissions".to_string(), "repository_selection".to_string(), "repositories".to_string(), "single_file".to_string(), "has_multiple_single_files".to_string(), "single_file_paths".to_string(), ] } } #[doc = "The authorization associated with an OAuth Access."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ApplicationGrant { pub id: i64, pub url: url::Url, pub app: App, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub scopes: Vec, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, } impl std::fmt::Display for ApplicationGrant { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ApplicationGrant { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.url), format!("{:?}", self.app), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.scopes), if let Some(user) = &self.user { format!("{:?}", user) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "url".to_string(), "app".to_string(), "created_at".to_string(), "updated_at".to_string(), "scopes".to_string(), "user".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableScopedInstallation { #[doc = "The permissions granted to the user-to-server access token."] pub permissions: AppPermissions, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: RepositorySelection, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_multiple_single_files: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file_paths: Option>, pub repositories_url: url::Url, #[doc = "Simple User"] pub account: SimpleUser, } impl std::fmt::Display for NullableScopedInstallation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableScopedInstallation { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.permissions), format!("{:?}", self.repository_selection), format!("{:?}", self.single_file_name), if let Some(has_multiple_single_files) = &self.has_multiple_single_files { format!("{:?}", has_multiple_single_files) } else { String::new() }, if let Some(single_file_paths) = &self.single_file_paths { format!("{:?}", single_file_paths) } else { String::new() }, format!("{:?}", self.repositories_url), format!("{:?}", self.account), ] } fn headers() -> Vec { vec![ "permissions".to_string(), "repository_selection".to_string(), "single_file_name".to_string(), "has_multiple_single_files".to_string(), "single_file_paths".to_string(), "repositories_url".to_string(), "account".to_string(), ] } } #[doc = "The authorization for an OAuth app, GitHub App, or a Personal Access Token."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Authorization { pub id: i64, pub url: url::Url, #[doc = "A list of scopes that this authorization is in."] #[serde(default, skip_serializing_if = "Option::is_none")] pub scopes: Option>, pub token: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub token_last_eight: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub hashed_token: Option, pub app: App, #[serde(default, skip_serializing_if = "Option::is_none")] pub note: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub note_url: Option, pub updated_at: chrono::DateTime, pub created_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub fingerprint: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub installation: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub expires_at: Option>, } impl std::fmt::Display for Authorization { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Authorization { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.url), format!("{:?}", self.scopes), self.token.clone(), format!("{:?}", self.token_last_eight), format!("{:?}", self.hashed_token), format!("{:?}", self.app), format!("{:?}", self.note), format!("{:?}", self.note_url), format!("{:?}", self.updated_at), format!("{:?}", self.created_at), format!("{:?}", self.fingerprint), if let Some(user) = &self.user { format!("{:?}", user) } else { String::new() }, if let Some(installation) = &self.installation { format!("{:?}", installation) } else { String::new() }, format!("{:?}", self.expires_at), ] } fn headers() -> Vec { vec![ "id".to_string(), "url".to_string(), "scopes".to_string(), "token".to_string(), "token_last_eight".to_string(), "hashed_token".to_string(), "app".to_string(), "note".to_string(), "note_url".to_string(), "updated_at".to_string(), "created_at".to_string(), "fingerprint".to_string(), "user".to_string(), "installation".to_string(), "expires_at".to_string(), ] } } #[doc = "A git repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ClassroomRepository { #[doc = "Unique identifier of the repository"] pub id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub node_id: Option, #[doc = "The name of the repository."] pub name: String, pub full_name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[doc = "Whether the repository is private or public."] pub private: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub branches_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub collaborators_url: Option, pub commits_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub contents_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub downloads_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub events_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub issue_events_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub issues_url: Option, pub pulls_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub ssh_url: Option, pub teams_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, pub size: i64, #[doc = "The default branch of the repository."] pub default_branch: String, pub open_issues_count: i64, #[doc = "Whether this repository acts as a template that can be used to generate new repositories."] pub is_template: bool, #[doc = "Whether the repository is archived."] pub archived: bool, pub clone_url: String, #[doc = "Returns whether or not this repository disabled."] pub disabled: bool, #[doc = "The repository visibility: public, private, or internal."] pub visibility: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub classroom_assignment: Option, } impl std::fmt::Display for ClassroomRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ClassroomRepository { const LENGTH: usize = 35; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), if let Some(node_id) = &self.node_id { format!("{:?}", node_id) } else { String::new() }, self.name.clone(), self.full_name.clone(), format!("{:?}", self.owner), format!("{:?}", self.private), if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, format!("{:?}", self.description), format!("{:?}", self.url), if let Some(branches_url) = &self.branches_url { format!("{:?}", branches_url) } else { String::new() }, if let Some(collaborators_url) = &self.collaborators_url { format!("{:?}", collaborators_url) } else { String::new() }, self.commits_url.clone(), if let Some(contents_url) = &self.contents_url { format!("{:?}", contents_url) } else { String::new() }, if let Some(downloads_url) = &self.downloads_url { format!("{:?}", downloads_url) } else { String::new() }, if let Some(events_url) = &self.events_url { format!("{:?}", events_url) } else { String::new() }, if let Some(git_url) = &self.git_url { format!("{:?}", git_url) } else { String::new() }, if let Some(issue_events_url) = &self.issue_events_url { format!("{:?}", issue_events_url) } else { String::new() }, if let Some(issues_url) = &self.issues_url { format!("{:?}", issues_url) } else { String::new() }, self.pulls_url.clone(), if let Some(ssh_url) = &self.ssh_url { format!("{:?}", ssh_url) } else { String::new() }, format!("{:?}", self.teams_url), if let Some(homepage) = &self.homepage { format!("{:?}", homepage) } else { String::new() }, format!("{:?}", self.language), format!("{:?}", self.size), self.default_branch.clone(), format!("{:?}", self.open_issues_count), format!("{:?}", self.is_template), format!("{:?}", self.archived), self.clone_url.clone(), format!("{:?}", self.disabled), self.visibility.clone(), format!("{:?}", self.pushed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.classroom_assignment), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "commits_url".to_string(), "contents_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "git_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "pulls_url".to_string(), "ssh_url".to_string(), "teams_url".to_string(), "homepage".to_string(), "language".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "archived".to_string(), "clone_url".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "classroom_assignment".to_string(), ] } } #[doc = "Code Of Conduct"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeOfConduct { pub key: String, pub name: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for CodeOfConduct { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeOfConduct { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ self.key.clone(), self.name.clone(), format!("{:?}", self.url), if let Some(body) = &self.body { format!("{:?}", body) } else { String::new() }, format!("{:?}", self.html_url), ] } fn headers() -> Vec { vec![ "key".to_string(), "name".to_string(), "url".to_string(), "body".to_string(), "html_url".to_string(), ] } } #[doc = "Response of S4 Proxy endpoint that provides GHES statistics"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ServerStatistics { #[serde(default, skip_serializing_if = "Option::is_none")] pub server_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub collection_date: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub schema_version: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub ghes_version: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub host_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub github_connect: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub ghe_stats: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub dormant_users: Option, } impl std::fmt::Display for ServerStatistics { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ServerStatistics { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ if let Some(server_id) = &self.server_id { format!("{:?}", server_id) } else { String::new() }, if let Some(collection_date) = &self.collection_date { format!("{:?}", collection_date) } else { String::new() }, if let Some(schema_version) = &self.schema_version { format!("{:?}", schema_version) } else { String::new() }, if let Some(ghes_version) = &self.ghes_version { format!("{:?}", ghes_version) } else { String::new() }, if let Some(host_name) = &self.host_name { format!("{:?}", host_name) } else { String::new() }, if let Some(github_connect) = &self.github_connect { format!("{:?}", github_connect) } else { String::new() }, if let Some(ghe_stats) = &self.ghe_stats { format!("{:?}", ghe_stats) } else { String::new() }, if let Some(dormant_users) = &self.dormant_users { format!("{:?}", dormant_users) } else { String::new() }, ] } fn headers() -> Vec { vec![ "server_id".to_string(), "collection_date".to_string(), "schema_version".to_string(), "ghes_version".to_string(), "host_name".to_string(), "github_connect".to_string(), "ghe_stats".to_string(), "dormant_users".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsCacheUsageOrgEnterprise { #[doc = "The count of active caches across all repositories of an enterprise or an organization."] pub total_active_caches_count: i64, #[doc = "The total size in bytes of all active cache items across all repositories of an enterprise or an organization."] pub total_active_caches_size_in_bytes: i64, } impl std::fmt::Display for ActionsCacheUsageOrgEnterprise { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsCacheUsageOrgEnterprise { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.total_active_caches_count), format!("{:?}", self.total_active_caches_size_in_bytes), ] } fn headers() -> Vec { vec![ "total_active_caches_count".to_string(), "total_active_caches_size_in_bytes".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsOidcCustomIssuerPolicyForEnterprise { #[doc = "Whether the enterprise customer requested a custom issuer URL."] #[serde(default, skip_serializing_if = "Option::is_none")] pub include_enterprise_slug: Option, } impl std::fmt::Display for ActionsOidcCustomIssuerPolicyForEnterprise { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsOidcCustomIssuerPolicyForEnterprise { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![ if let Some(include_enterprise_slug) = &self.include_enterprise_slug { format!("{:?}", include_enterprise_slug) } else { String::new() }, ] } fn headers() -> Vec { vec!["include_enterprise_slug".to_string()] } } #[doc = "The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum EnabledOrganizations { #[serde(rename = "all")] #[display("all")] All, #[serde(rename = "none")] #[display("none")] None, #[serde(rename = "selected")] #[display("selected")] Selected, } #[doc = "The permissions policy that controls the actions and reusable workflows that are allowed to run."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum AllowedActions { #[serde(rename = "all")] #[display("all")] All, #[serde(rename = "local_only")] #[display("local_only")] LocalOnly, #[serde(rename = "selected")] #[display("selected")] Selected, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsEnterprisePermissions { #[doc = "The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions."] pub enabled_organizations: EnabledOrganizations, #[doc = "The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_organizations_url: Option, #[doc = "The permissions policy that controls the actions and reusable workflows that are allowed to run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allowed_actions: Option, #[doc = "The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_actions_url: Option, } impl std::fmt::Display for ActionsEnterprisePermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsEnterprisePermissions { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.enabled_organizations), if let Some(selected_organizations_url) = &self.selected_organizations_url { format!("{:?}", selected_organizations_url) } else { String::new() }, if let Some(allowed_actions) = &self.allowed_actions { format!("{:?}", allowed_actions) } else { String::new() }, if let Some(selected_actions_url) = &self.selected_actions_url { format!("{:?}", selected_actions_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "enabled_organizations".to_string(), "selected_organizations_url".to_string(), "allowed_actions".to_string(), "selected_actions_url".to_string(), ] } } #[doc = "Organization Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationSimple { pub login: String, pub id: i64, pub node_id: String, pub url: url::Url, pub repos_url: url::Url, pub events_url: url::Url, pub hooks_url: String, pub issues_url: String, pub members_url: String, pub public_members_url: String, pub avatar_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, } impl std::fmt::Display for OrganizationSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationSimple { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.repos_url), format!("{:?}", self.events_url), self.hooks_url.clone(), self.issues_url.clone(), self.members_url.clone(), self.public_members_url.clone(), self.avatar_url.clone(), format!("{:?}", self.description), ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "node_id".to_string(), "url".to_string(), "repos_url".to_string(), "events_url".to_string(), "hooks_url".to_string(), "issues_url".to_string(), "members_url".to_string(), "public_members_url".to_string(), "avatar_url".to_string(), "description".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SelectedActions { #[doc = "Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub github_owned_allowed: Option, #[doc = "Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators."] #[serde(default, skip_serializing_if = "Option::is_none")] pub verified_allowed: Option, #[doc = "Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.\""] #[serde(default, skip_serializing_if = "Option::is_none")] pub patterns_allowed: Option>, } impl std::fmt::Display for SelectedActions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SelectedActions { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(github_owned_allowed) = &self.github_owned_allowed { format!("{:?}", github_owned_allowed) } else { String::new() }, if let Some(verified_allowed) = &self.verified_allowed { format!("{:?}", verified_allowed) } else { String::new() }, if let Some(patterns_allowed) = &self.patterns_allowed { format!("{:?}", patterns_allowed) } else { String::new() }, ] } fn headers() -> Vec { vec![ "github_owned_allowed".to_string(), "verified_allowed".to_string(), "patterns_allowed".to_string(), ] } } #[doc = "The default workflow permissions granted to the GITHUB_TOKEN when running workflows."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum ActionsDefaultWorkflowPermissions { #[serde(rename = "read")] #[display("read")] Read, #[serde(rename = "write")] #[display("write")] Write, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsGetDefaultWorkflowPermissions { #[doc = "The default workflow permissions granted to the GITHUB_TOKEN when running workflows."] pub default_workflow_permissions: ActionsDefaultWorkflowPermissions, #[doc = "Whether GitHub Actions can approve pull requests. Enabling this can be a security risk."] pub can_approve_pull_request_reviews: bool, } impl std::fmt::Display for ActionsGetDefaultWorkflowPermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsGetDefaultWorkflowPermissions { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.default_workflow_permissions), format!("{:?}", self.can_approve_pull_request_reviews), ] } fn headers() -> Vec { vec![ "default_workflow_permissions".to_string(), "can_approve_pull_request_reviews".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsSetDefaultWorkflowPermissions { #[doc = "The default workflow permissions granted to the GITHUB_TOKEN when running workflows."] #[serde(default, skip_serializing_if = "Option::is_none")] pub default_workflow_permissions: Option, #[doc = "Whether GitHub Actions can approve pull requests. Enabling this can be a security risk."] #[serde(default, skip_serializing_if = "Option::is_none")] pub can_approve_pull_request_reviews: Option, } impl std::fmt::Display for ActionsSetDefaultWorkflowPermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsSetDefaultWorkflowPermissions { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ if let Some(default_workflow_permissions) = &self.default_workflow_permissions { format!("{:?}", default_workflow_permissions) } else { String::new() }, if let Some(can_approve_pull_request_reviews) = &self.can_approve_pull_request_reviews { format!("{:?}", can_approve_pull_request_reviews) } else { String::new() }, ] } fn headers() -> Vec { vec![ "default_workflow_permissions".to_string(), "can_approve_pull_request_reviews".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RunnerGroupsEnterprise { pub id: f64, pub name: String, pub visibility: String, pub default: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_organizations_url: Option, pub runners_url: String, pub allows_public_repositories: bool, #[doc = "If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified."] #[serde(default, skip_serializing_if = "Option::is_none")] pub workflow_restrictions_read_only: Option, #[doc = "If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array."] #[serde(default, skip_serializing_if = "Option::is_none")] pub restricted_to_workflows: Option, #[doc = "List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_workflows: Option>, } impl std::fmt::Display for RunnerGroupsEnterprise { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RunnerGroupsEnterprise { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), self.visibility.clone(), format!("{:?}", self.default), if let Some(selected_organizations_url) = &self.selected_organizations_url { format!("{:?}", selected_organizations_url) } else { String::new() }, self.runners_url.clone(), format!("{:?}", self.allows_public_repositories), if let Some(workflow_restrictions_read_only) = &self.workflow_restrictions_read_only { format!("{:?}", workflow_restrictions_read_only) } else { String::new() }, if let Some(restricted_to_workflows) = &self.restricted_to_workflows { format!("{:?}", restricted_to_workflows) } else { String::new() }, if let Some(selected_workflows) = &self.selected_workflows { format!("{:?}", selected_workflows) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "visibility".to_string(), "default".to_string(), "selected_organizations_url".to_string(), "runners_url".to_string(), "allows_public_repositories".to_string(), "workflow_restrictions_read_only".to_string(), "restricted_to_workflows".to_string(), "selected_workflows".to_string(), ] } } #[doc = "A label for a self hosted runner"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RunnerLabel { #[doc = "Unique identifier of the label."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "Name of the label."] pub name: String, #[doc = "The type of label. Read-only labels are applied automatically when the runner is configured."] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, } impl std::fmt::Display for RunnerLabel { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RunnerLabel { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, self.name.clone(), if let Some(type_) = &self.type_ { format!("{:?}", type_) } else { String::new() }, ] } fn headers() -> Vec { vec!["id".to_string(), "name".to_string(), "type_".to_string()] } } #[doc = "A self hosted runner"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Runner { #[doc = "The id of the runner."] pub id: i64, #[doc = "The name of the runner."] pub name: String, #[doc = "The Operating System of the runner."] pub os: String, #[doc = "The status of the runner."] pub status: String, pub busy: bool, pub labels: Vec, } impl std::fmt::Display for Runner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Runner { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), self.os.clone(), self.status.clone(), format!("{:?}", self.busy), format!("{:?}", self.labels), ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "os".to_string(), "status".to_string(), "busy".to_string(), "labels".to_string(), ] } } #[doc = "Runner Application"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RunnerApplication { pub os: String, pub architecture: String, pub download_url: String, pub filename: String, #[doc = "A short lived bearer token used to download the runner, if needed."] #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_download_token: Option, #[serde( rename = "sha256_checksum", default, skip_serializing_if = "Option::is_none" )] pub sha_256_checksum: Option, } impl std::fmt::Display for RunnerApplication { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RunnerApplication { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.os.clone(), self.architecture.clone(), self.download_url.clone(), self.filename.clone(), if let Some(temp_download_token) = &self.temp_download_token { format!("{:?}", temp_download_token) } else { String::new() }, if let Some(sha_256_checksum) = &self.sha_256_checksum { format!("{:?}", sha_256_checksum) } else { String::new() }, ] } fn headers() -> Vec { vec![ "os".to_string(), "architecture".to_string(), "download_url".to_string(), "filename".to_string(), "temp_download_token".to_string(), "sha_256_checksum".to_string(), ] } } #[doc = "Authentication Token"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AuthenticationToken { #[doc = "The token used for authentication"] pub token: String, #[doc = "The time this token expires"] pub expires_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[doc = "The repositories this token has access to"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repositories: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub single_file: Option, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_selection: Option, } impl std::fmt::Display for AuthenticationToken { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AuthenticationToken { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.token.clone(), format!("{:?}", self.expires_at), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(repositories) = &self.repositories { format!("{:?}", repositories) } else { String::new() }, if let Some(single_file) = &self.single_file { format!("{:?}", single_file) } else { String::new() }, if let Some(repository_selection) = &self.repository_selection { format!("{:?}", repository_selection) } else { String::new() }, ] } fn headers() -> Vec { vec![ "token".to_string(), "expires_at".to_string(), "permissions".to_string(), "repositories".to_string(), "single_file".to_string(), "repository_selection".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AuditLogEvent { #[doc = "The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time)."] #[serde( rename = "@timestamp", default, skip_serializing_if = "Option::is_none" )] pub timestamp: Option, #[doc = "The name of the action that was performed, for example `user.login` or `repo.create`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub active: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub active_was: Option, #[doc = "The actor who performed the action."] #[serde(default, skip_serializing_if = "Option::is_none")] pub actor: Option, #[doc = "The id of the actor who performed the action."] #[serde(default, skip_serializing_if = "Option::is_none")] pub actor_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub actor_location: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub data: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub org_id: Option, #[doc = "The username of the account being blocked."] #[serde(default, skip_serializing_if = "Option::is_none")] pub blocked_user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub business: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub config: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub config_was: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub content_type: Option, #[doc = "The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub deploy_key_fingerprint: Option, #[doc = "A unique identifier for an audit event."] #[serde( rename = "_document_id", default, skip_serializing_if = "Option::is_none" )] pub document_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub emoji: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub events: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub events_were: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub explanation: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub fingerprint: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub hook_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub limited_availability: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub old_user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub openssh_public_key: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub org: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub previous_visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub read_only: Option, #[doc = "The name of the repository."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repo: Option, #[doc = "The name of the repository."] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_public: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub target_login: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub team: Option, #[doc = "The type of protocol (for example, HTTP or SSH) used to transfer Git data."] #[serde(default, skip_serializing_if = "Option::is_none")] pub transport_protocol: Option, #[doc = "A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data."] #[serde(default, skip_serializing_if = "Option::is_none")] pub transport_protocol_name: Option, #[doc = "The user that was affected by the action performed (if available)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[doc = "The repository visibility, for example `public` or `private`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, } impl std::fmt::Display for AuditLogEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AuditLogEvent { const LENGTH: usize = 40; fn fields(&self) -> Vec { vec![ if let Some(timestamp) = &self.timestamp { format!("{:?}", timestamp) } else { String::new() }, if let Some(action) = &self.action { format!("{:?}", action) } else { String::new() }, if let Some(active) = &self.active { format!("{:?}", active) } else { String::new() }, if let Some(active_was) = &self.active_was { format!("{:?}", active_was) } else { String::new() }, if let Some(actor) = &self.actor { format!("{:?}", actor) } else { String::new() }, if let Some(actor_id) = &self.actor_id { format!("{:?}", actor_id) } else { String::new() }, if let Some(actor_location) = &self.actor_location { format!("{:?}", actor_location) } else { String::new() }, if let Some(data) = &self.data { format!("{:?}", data) } else { String::new() }, if let Some(org_id) = &self.org_id { format!("{:?}", org_id) } else { String::new() }, if let Some(blocked_user) = &self.blocked_user { format!("{:?}", blocked_user) } else { String::new() }, if let Some(business) = &self.business { format!("{:?}", business) } else { String::new() }, if let Some(config) = &self.config { format!("{:?}", config) } else { String::new() }, if let Some(config_was) = &self.config_was { format!("{:?}", config_was) } else { String::new() }, if let Some(content_type) = &self.content_type { format!("{:?}", content_type) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, if let Some(deploy_key_fingerprint) = &self.deploy_key_fingerprint { format!("{:?}", deploy_key_fingerprint) } else { String::new() }, if let Some(document_id) = &self.document_id { format!("{:?}", document_id) } else { String::new() }, if let Some(emoji) = &self.emoji { format!("{:?}", emoji) } else { String::new() }, if let Some(events) = &self.events { format!("{:?}", events) } else { String::new() }, if let Some(events_were) = &self.events_were { format!("{:?}", events_were) } else { String::new() }, if let Some(explanation) = &self.explanation { format!("{:?}", explanation) } else { String::new() }, if let Some(fingerprint) = &self.fingerprint { format!("{:?}", fingerprint) } else { String::new() }, if let Some(hook_id) = &self.hook_id { format!("{:?}", hook_id) } else { String::new() }, if let Some(limited_availability) = &self.limited_availability { format!("{:?}", limited_availability) } else { String::new() }, if let Some(message) = &self.message { format!("{:?}", message) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(old_user) = &self.old_user { format!("{:?}", old_user) } else { String::new() }, if let Some(openssh_public_key) = &self.openssh_public_key { format!("{:?}", openssh_public_key) } else { String::new() }, if let Some(org) = &self.org { format!("{:?}", org) } else { String::new() }, if let Some(previous_visibility) = &self.previous_visibility { format!("{:?}", previous_visibility) } else { String::new() }, if let Some(read_only) = &self.read_only { format!("{:?}", read_only) } else { String::new() }, if let Some(repo) = &self.repo { format!("{:?}", repo) } else { String::new() }, if let Some(repository) = &self.repository { format!("{:?}", repository) } else { String::new() }, if let Some(repository_public) = &self.repository_public { format!("{:?}", repository_public) } else { String::new() }, if let Some(target_login) = &self.target_login { format!("{:?}", target_login) } else { String::new() }, if let Some(team) = &self.team { format!("{:?}", team) } else { String::new() }, if let Some(transport_protocol) = &self.transport_protocol { format!("{:?}", transport_protocol) } else { String::new() }, if let Some(transport_protocol_name) = &self.transport_protocol_name { format!("{:?}", transport_protocol_name) } else { String::new() }, if let Some(user) = &self.user { format!("{:?}", user) } else { String::new() }, if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, ] } fn headers() -> Vec { vec![ "timestamp".to_string(), "action".to_string(), "active".to_string(), "active_was".to_string(), "actor".to_string(), "actor_id".to_string(), "actor_location".to_string(), "data".to_string(), "org_id".to_string(), "blocked_user".to_string(), "business".to_string(), "config".to_string(), "config_was".to_string(), "content_type".to_string(), "created_at".to_string(), "deploy_key_fingerprint".to_string(), "document_id".to_string(), "emoji".to_string(), "events".to_string(), "events_were".to_string(), "explanation".to_string(), "fingerprint".to_string(), "hook_id".to_string(), "limited_availability".to_string(), "message".to_string(), "name".to_string(), "old_user".to_string(), "openssh_public_key".to_string(), "org".to_string(), "previous_visibility".to_string(), "read_only".to_string(), "repo".to_string(), "repository".to_string(), "repository_public".to_string(), "target_login".to_string(), "team".to_string(), "transport_protocol".to_string(), "transport_protocol_name".to_string(), "user".to_string(), "visibility".to_string(), ] } } #[doc = "State of a code scanning alert."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum CodeScanningAlertState { #[serde(rename = "open")] #[display("open")] Open, #[serde(rename = "closed")] #[display("closed")] Closed, #[serde(rename = "dismissed")] #[display("dismissed")] Dismissed, #[serde(rename = "fixed")] #[display("fixed")] Fixed, } #[doc = "**Required when the state is dismissed.** The reason for dismissing or closing the alert."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum CodeScanningAlertDismissedReason { #[serde(rename = "false positive")] #[display("false positive")] FalsePositive, #[serde(rename = "won't fix")] #[display("won't fix")] WonTFix, #[serde(rename = "used in tests")] #[display("used in tests")] UsedInTests, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlertRule { #[doc = "A unique identifier for the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "The name of the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "The severity of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub severity: Option, #[doc = "The security severity of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub security_severity_level: Option, #[doc = "A short description of the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "description of the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub full_description: Option, #[doc = "A set of tags applicable for the rule."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option>, #[doc = "Detailed documentation for the rule as GitHub Flavored Markdown."] #[serde(default, skip_serializing_if = "Option::is_none")] pub help: Option, } impl std::fmt::Display for CodeScanningAlertRule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlertRule { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(severity) = &self.severity { format!("{:?}", severity) } else { String::new() }, if let Some(security_severity_level) = &self.security_severity_level { format!("{:?}", security_severity_level) } else { String::new() }, if let Some(description) = &self.description { format!("{:?}", description) } else { String::new() }, if let Some(full_description) = &self.full_description { format!("{:?}", full_description) } else { String::new() }, if let Some(tags) = &self.tags { format!("{:?}", tags) } else { String::new() }, if let Some(help) = &self.help { format!("{:?}", help) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "severity".to_string(), "security_severity_level".to_string(), "description".to_string(), "full_description".to_string(), "tags".to_string(), "help".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAnalysisTool { #[doc = "The name of the tool used to generate the code scanning analysis."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "The version of the tool used to generate the code scanning analysis."] #[serde(default, skip_serializing_if = "Option::is_none")] pub version: Option, #[doc = "The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data."] #[serde(default, skip_serializing_if = "Option::is_none")] pub guid: Option, } impl std::fmt::Display for CodeScanningAnalysisTool { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAnalysisTool { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(version) = &self.version { format!("{:?}", version) } else { String::new() }, if let Some(guid) = &self.guid { format!("{:?}", guid) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "version".to_string(), "guid".to_string(), ] } } #[doc = "Describe a region within a file for the alert."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlertLocation { #[serde(default, skip_serializing_if = "Option::is_none")] pub path: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub start_line: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub end_line: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub start_column: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub end_column: Option, } impl std::fmt::Display for CodeScanningAlertLocation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlertLocation { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ if let Some(path) = &self.path { format!("{:?}", path) } else { String::new() }, if let Some(start_line) = &self.start_line { format!("{:?}", start_line) } else { String::new() }, if let Some(end_line) = &self.end_line { format!("{:?}", end_line) } else { String::new() }, if let Some(start_column) = &self.start_column { format!("{:?}", start_column) } else { String::new() }, if let Some(end_column) = &self.end_column { format!("{:?}", end_column) } else { String::new() }, ] } fn headers() -> Vec { vec![ "path".to_string(), "start_line".to_string(), "end_line".to_string(), "start_column".to_string(), "end_column".to_string(), ] } } #[doc = "A classification of the file. For example to identify it as generated."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum CodeScanningAlertClassification { #[serde(rename = "source")] #[display("source")] Source, #[serde(rename = "generated")] #[display("generated")] Generated, #[serde(rename = "test")] #[display("test")] Test, #[serde(rename = "library")] #[display("library")] Library, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlertInstance { #[doc = "The full Git reference, formatted as `refs/heads/`,\n`refs/pull//merge`, or `refs/pull//head`."] #[serde(rename = "ref", default, skip_serializing_if = "Option::is_none")] pub ref_: Option, #[doc = "Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name."] #[serde(default, skip_serializing_if = "Option::is_none")] pub analysis_key: Option, #[doc = "Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed."] #[serde(default, skip_serializing_if = "Option::is_none")] pub environment: Option, #[doc = "Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code."] #[serde(default, skip_serializing_if = "Option::is_none")] pub category: Option, #[doc = "State of a code scanning alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_sha: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[doc = "Describe a region within a file for the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub location: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[doc = "Classifications that have been applied to the file that triggered the alert.\nFor example identifying it as documentation, or a generated file."] #[serde(default, skip_serializing_if = "Option::is_none")] pub classifications: Option>>, } impl std::fmt::Display for CodeScanningAlertInstance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlertInstance { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ if let Some(ref_) = &self.ref_ { format!("{:?}", ref_) } else { String::new() }, if let Some(analysis_key) = &self.analysis_key { format!("{:?}", analysis_key) } else { String::new() }, if let Some(environment) = &self.environment { format!("{:?}", environment) } else { String::new() }, if let Some(category) = &self.category { format!("{:?}", category) } else { String::new() }, if let Some(state) = &self.state { format!("{:?}", state) } else { String::new() }, if let Some(commit_sha) = &self.commit_sha { format!("{:?}", commit_sha) } else { String::new() }, if let Some(message) = &self.message { format!("{:?}", message) } else { String::new() }, if let Some(location) = &self.location { format!("{:?}", location) } else { String::new() }, if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, if let Some(classifications) = &self.classifications { format!("{:?}", classifications) } else { String::new() }, ] } fn headers() -> Vec { vec![ "ref_".to_string(), "analysis_key".to_string(), "environment".to_string(), "category".to_string(), "state".to_string(), "commit_sha".to_string(), "message".to_string(), "location".to_string(), "html_url".to_string(), "classifications".to_string(), ] } } #[doc = "Simple Repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SimpleRepository { #[doc = "A unique identifier of the repository."] pub id: i64, #[doc = "The GraphQL identifier of the repository."] pub node_id: String, #[doc = "The name of the repository."] pub name: String, #[doc = "The full, globally unique, name of the repository."] pub full_name: String, #[doc = "Simple User"] pub owner: SimpleUser, #[doc = "Whether the repository is private."] pub private: bool, #[doc = "The URL to view the repository on GitHub.com."] pub html_url: url::Url, #[doc = "The repository description."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Whether the repository is a fork."] pub fork: bool, #[doc = "The URL to get more information about the repository from the GitHub API."] pub url: url::Url, #[doc = "A template for the API URL to download the repository as an archive."] pub archive_url: String, #[doc = "A template for the API URL to list the available assignees for issues in the repository."] pub assignees_url: String, #[doc = "A template for the API URL to create or retrieve a raw Git blob in the repository."] pub blobs_url: String, #[doc = "A template for the API URL to get information about branches in the repository."] pub branches_url: String, #[doc = "A template for the API URL to get information about collaborators of the repository."] pub collaborators_url: String, #[doc = "A template for the API URL to get information about comments on the repository."] pub comments_url: String, #[doc = "A template for the API URL to get information about commits on the repository."] pub commits_url: String, #[doc = "A template for the API URL to compare two commits or refs."] pub compare_url: String, #[doc = "A template for the API URL to get the contents of the repository."] pub contents_url: String, #[doc = "A template for the API URL to list the contributors to the repository."] pub contributors_url: url::Url, #[doc = "The API URL to list the deployments of the repository."] pub deployments_url: url::Url, #[doc = "The API URL to list the downloads on the repository."] pub downloads_url: url::Url, #[doc = "The API URL to list the events of the repository."] pub events_url: url::Url, #[doc = "The API URL to list the forks of the repository."] pub forks_url: url::Url, #[doc = "A template for the API URL to get information about Git commits of the repository."] pub git_commits_url: String, #[doc = "A template for the API URL to get information about Git refs of the repository."] pub git_refs_url: String, #[doc = "A template for the API URL to get information about Git tags of the repository."] pub git_tags_url: String, #[doc = "A template for the API URL to get information about issue comments on the repository."] pub issue_comment_url: String, #[doc = "A template for the API URL to get information about issue events on the repository."] pub issue_events_url: String, #[doc = "A template for the API URL to get information about issues on the repository."] pub issues_url: String, #[doc = "A template for the API URL to get information about deploy keys on the repository."] pub keys_url: String, #[doc = "A template for the API URL to get information about labels of the repository."] pub labels_url: String, #[doc = "The API URL to get information about the languages of the repository."] pub languages_url: url::Url, #[doc = "The API URL to merge branches in the repository."] pub merges_url: url::Url, #[doc = "A template for the API URL to get information about milestones of the repository."] pub milestones_url: String, #[doc = "A template for the API URL to get information about notifications on the repository."] pub notifications_url: String, #[doc = "A template for the API URL to get information about pull requests on the repository."] pub pulls_url: String, #[doc = "A template for the API URL to get information about releases on the repository."] pub releases_url: String, #[doc = "The API URL to list the stargazers on the repository."] pub stargazers_url: url::Url, #[doc = "A template for the API URL to get information about statuses of a commit."] pub statuses_url: String, #[doc = "The API URL to list the subscribers on the repository."] pub subscribers_url: url::Url, #[doc = "The API URL to subscribe to notifications for this repository."] pub subscription_url: url::Url, #[doc = "The API URL to get information about tags on the repository."] pub tags_url: url::Url, #[doc = "The API URL to list the teams on the repository."] pub teams_url: url::Url, #[doc = "A template for the API URL to create or retrieve a raw Git tree of the repository."] pub trees_url: String, #[doc = "The API URL to list the hooks on the repository."] pub hooks_url: url::Url, } impl std::fmt::Display for SimpleRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SimpleRepository { const LENGTH: usize = 46; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), format!("{:?}", self.hooks_url), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "hooks_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningOrganizationAlertItems { #[doc = "The security alert number."] pub number: i64, #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] pub created_at: chrono::DateTime, #[doc = "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "The REST API URL of the alert resource."] pub url: url::Url, #[doc = "The GitHub URL of the alert resource."] pub html_url: url::Url, #[doc = "The REST API URL for fetching the list of instances for an alert."] pub instances_url: url::Url, #[doc = "State of a code scanning alert."] pub state: CodeScanningAlertState, #[doc = "The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub fixed_at: Option>, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_by: Option, #[doc = "The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_at: Option>, #[doc = "**Required when the state is dismissed.** The reason for dismissing or closing the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_reason: Option, #[doc = "The dismissal comment associated with the dismissal of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_comment: Option, pub rule: CodeScanningAlertRule, pub tool: CodeScanningAnalysisTool, pub most_recent_instance: CodeScanningAlertInstance, #[doc = "Simple Repository"] pub repository: SimpleRepository, } impl std::fmt::Display for CodeScanningOrganizationAlertItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningOrganizationAlertItems { const LENGTH: usize = 16; fn fields(&self) -> Vec { vec![ format!("{:?}", self.number), format!("{:?}", self.created_at), if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.instances_url), format!("{:?}", self.state), if let Some(fixed_at) = &self.fixed_at { format!("{:?}", fixed_at) } else { String::new() }, format!("{:?}", self.dismissed_by), format!("{:?}", self.dismissed_at), format!("{:?}", self.dismissed_reason), if let Some(dismissed_comment) = &self.dismissed_comment { format!("{:?}", dismissed_comment) } else { String::new() }, format!("{:?}", self.rule), format!("{:?}", self.tool), format!("{:?}", self.most_recent_instance), format!("{:?}", self.repository), ] } fn headers() -> Vec { vec![ "number".to_string(), "created_at".to_string(), "updated_at".to_string(), "url".to_string(), "html_url".to_string(), "instances_url".to_string(), "state".to_string(), "fixed_at".to_string(), "dismissed_by".to_string(), "dismissed_at".to_string(), "dismissed_reason".to_string(), "dismissed_comment".to_string(), "rule".to_string(), "tool".to_string(), "most_recent_instance".to_string(), "repository".to_string(), ] } } #[doc = "The License Sync Consumed Licenses Information"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GetConsumedLicenses { #[serde(default, skip_serializing_if = "Option::is_none")] pub total_seats_consumed: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub total_seats_purchased: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub users: Option>, } impl std::fmt::Display for GetConsumedLicenses { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GetConsumedLicenses { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(total_seats_consumed) = &self.total_seats_consumed { format!("{:?}", total_seats_consumed) } else { String::new() }, if let Some(total_seats_purchased) = &self.total_seats_purchased { format!("{:?}", total_seats_purchased) } else { String::new() }, if let Some(users) = &self.users { format!("{:?}", users) } else { String::new() }, ] } fn headers() -> Vec { vec![ "total_seats_consumed".to_string(), "total_seats_purchased".to_string(), "users".to_string(), ] } } #[doc = "A per instance information regarding the status of the License Sync Job."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GetLicenseSyncStatus { #[serde(default, skip_serializing_if = "Option::is_none")] pub server_instances: Option>, } impl std::fmt::Display for GetLicenseSyncStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GetLicenseSyncStatus { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![if let Some(server_instances) = &self.server_instances { format!("{:?}", server_instances) } else { String::new() }] } fn headers() -> Vec { vec!["server_instances".to_string()] } } #[doc = "Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum SecretScanningAlertState { #[serde(rename = "open")] #[display("open")] Open, #[serde(rename = "resolved")] #[display("resolved")] Resolved, } #[doc = "**Required when the `state` is `resolved`.** The reason for resolving the alert."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum SecretScanningAlertResolution { #[serde(rename = "false_positive")] #[display("false_positive")] FalsePositive, #[serde(rename = "wont_fix")] #[display("wont_fix")] WontFix, #[serde(rename = "revoked")] #[display("revoked")] Revoked, #[serde(rename = "used_in_tests")] #[display("used_in_tests")] UsedInTests, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationSecretScanningAlert { #[doc = "The security alert number."] #[serde(default, skip_serializing_if = "Option::is_none")] pub number: Option, #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[doc = "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "The REST API URL of the alert resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[doc = "The GitHub URL of the alert resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[doc = "The REST API URL of the code locations for this alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub locations_url: Option, #[doc = "Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, #[doc = "**Required when the `state` is `resolved`.** The reason for resolving the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub resolution: Option, #[doc = "The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub resolved_at: Option>, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub resolved_by: Option, #[doc = "The type of secret that secret scanning detected."] #[serde(default, skip_serializing_if = "Option::is_none")] pub secret_type: Option, #[doc = "User-friendly name for the detected secret, matching the `secret_type`.\nFor a list of built-in patterns, see \"[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security).\""] #[serde(default, skip_serializing_if = "Option::is_none")] pub secret_type_display_name: Option, #[doc = "The secret that was detected."] #[serde(default, skip_serializing_if = "Option::is_none")] pub secret: Option, #[doc = "Simple Repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository: Option, #[doc = "Whether push protection was bypassed for the detected secret."] #[serde(default, skip_serializing_if = "Option::is_none")] pub push_protection_bypassed: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub push_protection_bypassed_by: Option, #[doc = "The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub push_protection_bypassed_at: Option>, } impl std::fmt::Display for OrganizationSecretScanningAlert { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationSecretScanningAlert { const LENGTH: usize = 17; fn fields(&self) -> Vec { vec![ if let Some(number) = &self.number { format!("{:?}", number) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, if let Some(locations_url) = &self.locations_url { format!("{:?}", locations_url) } else { String::new() }, if let Some(state) = &self.state { format!("{:?}", state) } else { String::new() }, if let Some(resolution) = &self.resolution { format!("{:?}", resolution) } else { String::new() }, if let Some(resolved_at) = &self.resolved_at { format!("{:?}", resolved_at) } else { String::new() }, if let Some(resolved_by) = &self.resolved_by { format!("{:?}", resolved_by) } else { String::new() }, if let Some(secret_type) = &self.secret_type { format!("{:?}", secret_type) } else { String::new() }, if let Some(secret_type_display_name) = &self.secret_type_display_name { format!("{:?}", secret_type_display_name) } else { String::new() }, if let Some(secret) = &self.secret { format!("{:?}", secret) } else { String::new() }, if let Some(repository) = &self.repository { format!("{:?}", repository) } else { String::new() }, if let Some(push_protection_bypassed) = &self.push_protection_bypassed { format!("{:?}", push_protection_bypassed) } else { String::new() }, if let Some(push_protection_bypassed_by) = &self.push_protection_bypassed_by { format!("{:?}", push_protection_bypassed_by) } else { String::new() }, if let Some(push_protection_bypassed_at) = &self.push_protection_bypassed_at { format!("{:?}", push_protection_bypassed_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "number".to_string(), "created_at".to_string(), "updated_at".to_string(), "url".to_string(), "html_url".to_string(), "locations_url".to_string(), "state".to_string(), "resolution".to_string(), "resolved_at".to_string(), "resolved_by".to_string(), "secret_type".to_string(), "secret_type_display_name".to_string(), "secret".to_string(), "repository".to_string(), "push_protection_bypassed".to_string(), "push_protection_bypassed_by".to_string(), "push_protection_bypassed_at".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsBillingUsage { #[doc = "The sum of the free and paid GitHub Actions minutes used."] pub total_minutes_used: i64, #[doc = "The total paid GitHub Actions minutes used."] pub total_paid_minutes_used: i64, #[doc = "The amount of free GitHub Actions minutes available."] pub included_minutes: i64, pub minutes_used_breakdown: MinutesUsedBreakdown, } impl std::fmt::Display for ActionsBillingUsage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsBillingUsage { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.total_minutes_used), format!("{:?}", self.total_paid_minutes_used), format!("{:?}", self.included_minutes), format!("{:?}", self.minutes_used_breakdown), ] } fn headers() -> Vec { vec![ "total_minutes_used".to_string(), "total_paid_minutes_used".to_string(), "included_minutes".to_string(), "minutes_used_breakdown".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AdvancedSecurityActiveCommittersUser { pub user_login: String, pub last_pushed_date: String, } impl std::fmt::Display for AdvancedSecurityActiveCommittersUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AdvancedSecurityActiveCommittersUser { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.user_login.clone(), self.last_pushed_date.clone()] } fn headers() -> Vec { vec!["user_login".to_string(), "last_pushed_date".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AdvancedSecurityActiveCommittersRepository { pub name: String, pub advanced_security_committers: i64, pub advanced_security_committers_breakdown: Vec, } impl std::fmt::Display for AdvancedSecurityActiveCommittersRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AdvancedSecurityActiveCommittersRepository { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.advanced_security_committers), format!("{:?}", self.advanced_security_committers_breakdown), ] } fn headers() -> Vec { vec![ "name".to_string(), "advanced_security_committers".to_string(), "advanced_security_committers_breakdown".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AdvancedSecurityActiveCommitters { #[serde(default, skip_serializing_if = "Option::is_none")] pub total_advanced_security_committers: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub total_count: Option, pub repositories: Vec, } impl std::fmt::Display for AdvancedSecurityActiveCommitters { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AdvancedSecurityActiveCommitters { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(total_advanced_security_committers) = &self.total_advanced_security_committers { format!("{:?}", total_advanced_security_committers) } else { String::new() }, if let Some(total_count) = &self.total_count { format!("{:?}", total_count) } else { String::new() }, format!("{:?}", self.repositories), ] } fn headers() -> Vec { vec![ "total_advanced_security_committers".to_string(), "total_count".to_string(), "repositories".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PackagesBillingUsage { #[doc = "Sum of the free and paid storage space (GB) for GitHuub Packages."] pub total_gigabytes_bandwidth_used: i64, #[doc = "Total paid storage space (GB) for GitHuub Packages."] pub total_paid_gigabytes_bandwidth_used: i64, #[doc = "Free storage space (GB) for GitHub Packages."] pub included_gigabytes_bandwidth: i64, } impl std::fmt::Display for PackagesBillingUsage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PackagesBillingUsage { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.total_gigabytes_bandwidth_used), format!("{:?}", self.total_paid_gigabytes_bandwidth_used), format!("{:?}", self.included_gigabytes_bandwidth), ] } fn headers() -> Vec { vec![ "total_gigabytes_bandwidth_used".to_string(), "total_paid_gigabytes_bandwidth_used".to_string(), "included_gigabytes_bandwidth".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CombinedBillingUsage { #[doc = "Numbers of days left in billing cycle."] pub days_left_in_billing_cycle: i64, #[doc = "Estimated storage space (GB) used in billing cycle."] pub estimated_paid_storage_for_month: i64, #[doc = "Estimated sum of free and paid storage space (GB) used in billing cycle."] pub estimated_storage_for_month: i64, } impl std::fmt::Display for CombinedBillingUsage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CombinedBillingUsage { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.days_left_in_billing_cycle), format!("{:?}", self.estimated_paid_storage_for_month), format!("{:?}", self.estimated_storage_for_month), ] } fn headers() -> Vec { vec![ "days_left_in_billing_cycle".to_string(), "estimated_paid_storage_for_month".to_string(), "estimated_storage_for_month".to_string(), ] } } #[doc = "Actor"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Actor { pub id: i64, pub login: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub display_login: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub avatar_url: url::Url, } impl std::fmt::Display for Actor { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Actor { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.login.clone(), if let Some(display_login) = &self.display_login { format!("{:?}", display_login) } else { String::new() }, format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.avatar_url), ] } fn headers() -> Vec { vec![ "id".to_string(), "login".to_string(), "display_login".to_string(), "gravatar_id".to_string(), "url".to_string(), "avatar_url".to_string(), ] } } #[doc = "A collection of related issues and pull requests."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableMilestone { pub url: url::Url, pub html_url: url::Url, pub labels_url: url::Url, pub id: i64, pub node_id: String, #[doc = "The number of the milestone."] pub number: i64, #[doc = "The state of the milestone."] pub state: State, #[doc = "The title of the milestone."] pub title: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, pub open_issues: i64, pub closed_issues: i64, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub due_on: Option>, } impl std::fmt::Display for NullableMilestone { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableMilestone { const LENGTH: usize = 16; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.labels_url), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.number), format!("{:?}", self.state), self.title.clone(), format!("{:?}", self.description), format!("{:?}", self.creator), format!("{:?}", self.open_issues), format!("{:?}", self.closed_issues), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.closed_at), format!("{:?}", self.due_on), ] } fn headers() -> Vec { vec![ "url".to_string(), "html_url".to_string(), "labels_url".to_string(), "id".to_string(), "node_id".to_string(), "number".to_string(), "state".to_string(), "title".to_string(), "description".to_string(), "creator".to_string(), "open_issues".to_string(), "closed_issues".to_string(), "created_at".to_string(), "updated_at".to_string(), "closed_at".to_string(), "due_on".to_string(), ] } } #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableIntegration { #[doc = "Unique identifier of the GitHub app"] pub id: i64, #[doc = "The slug name of the GitHub app"] #[serde(default, skip_serializing_if = "Option::is_none")] pub slug: Option, pub node_id: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[doc = "The name of the GitHub app"] pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub external_url: url::Url, pub html_url: url::Url, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "The set of permissions for the GitHub app"] pub permissions: Permissions, #[doc = "The list of events for the GitHub app"] pub events: Vec, #[doc = "The number of installations associated with the GitHub app"] #[serde(default, skip_serializing_if = "Option::is_none")] pub installations_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub client_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub webhook_secret: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pem: Option, } impl std::fmt::Display for NullableIntegration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableIntegration { const LENGTH: usize = 17; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), if let Some(slug) = &self.slug { format!("{:?}", slug) } else { String::new() }, self.node_id.clone(), format!("{:?}", self.owner), self.name.clone(), format!("{:?}", self.description), format!("{:?}", self.external_url), format!("{:?}", self.html_url), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.permissions), format!("{:?}", self.events), if let Some(installations_count) = &self.installations_count { format!("{:?}", installations_count) } else { String::new() }, if let Some(client_id) = &self.client_id { format!("{:?}", client_id) } else { String::new() }, if let Some(client_secret) = &self.client_secret { format!("{:?}", client_secret) } else { String::new() }, if let Some(webhook_secret) = &self.webhook_secret { format!("{:?}", webhook_secret) } else { String::new() }, if let Some(pem) = &self.pem { format!("{:?}", pem) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "slug".to_string(), "node_id".to_string(), "owner".to_string(), "name".to_string(), "description".to_string(), "external_url".to_string(), "html_url".to_string(), "created_at".to_string(), "updated_at".to_string(), "permissions".to_string(), "events".to_string(), "installations_count".to_string(), "client_id".to_string(), "client_secret".to_string(), "webhook_secret".to_string(), "pem".to_string(), ] } } #[doc = "How the author is associated with the repository."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum AuthorAssociation { #[serde(rename = "COLLABORATOR")] #[display("COLLABORATOR")] Collaborator, #[serde(rename = "CONTRIBUTOR")] #[display("CONTRIBUTOR")] Contributor, #[serde(rename = "FIRST_TIMER")] #[display("FIRST_TIMER")] FirstTimer, #[serde(rename = "FIRST_TIME_CONTRIBUTOR")] #[display("FIRST_TIME_CONTRIBUTOR")] FirstTimeContributor, #[serde(rename = "MANNEQUIN")] #[display("MANNEQUIN")] Mannequin, #[serde(rename = "MEMBER")] #[display("MEMBER")] Member, #[serde(rename = "NONE")] #[display("NONE")] None, #[serde(rename = "OWNER")] #[display("OWNER")] Owner, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ReactionRollup { pub url: url::Url, pub total_count: i64, #[serde(rename = "+1")] pub plus_one: i64, #[serde(rename = "-1")] pub minus_one: i64, pub laugh: i64, pub confused: i64, pub heart: i64, pub hooray: i64, pub eyes: i64, pub rocket: i64, } impl std::fmt::Display for ReactionRollup { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ReactionRollup { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.total_count), format!("{:?}", self.plus_one), format!("{:?}", self.minus_one), format!("{:?}", self.laugh), format!("{:?}", self.confused), format!("{:?}", self.heart), format!("{:?}", self.hooray), format!("{:?}", self.eyes), format!("{:?}", self.rocket), ] } fn headers() -> Vec { vec![ "url".to_string(), "total_count".to_string(), "plus_one".to_string(), "minus_one".to_string(), "laugh".to_string(), "confused".to_string(), "heart".to_string(), "hooray".to_string(), "eyes".to_string(), "rocket".to_string(), ] } } #[doc = "Issues are a great way to keep track of tasks, enhancements, and bugs for your projects."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Issue { pub id: i64, pub node_id: String, #[doc = "URL for the issue"] pub url: url::Url, pub repository_url: url::Url, pub labels_url: String, pub comments_url: url::Url, pub events_url: url::Url, pub html_url: url::Url, #[doc = "Number uniquely identifying the issue within its repository"] pub number: i64, #[doc = "State of the issue; either 'open' or 'closed'"] pub state: String, #[doc = "The reason for the current state"] #[serde(default, skip_serializing_if = "Option::is_none")] pub state_reason: Option, #[doc = "Title of the issue"] pub title: String, #[doc = "Contents of the issue"] #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[doc = "Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository"] pub labels: Vec, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub assignees: Option>, #[doc = "A collection of related issues and pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, pub locked: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub active_lock_reason: Option, pub comments: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub pull_request: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_at: Option>, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub draft: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_by: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_html: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_text: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub timeline_url: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for Issue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Issue { const LENGTH: usize = 34; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.repository_url), self.labels_url.clone(), format!("{:?}", self.comments_url), format!("{:?}", self.events_url), format!("{:?}", self.html_url), format!("{:?}", self.number), self.state.clone(), if let Some(state_reason) = &self.state_reason { format!("{:?}", state_reason) } else { String::new() }, self.title.clone(), if let Some(body) = &self.body { format!("{:?}", body) } else { String::new() }, format!("{:?}", self.user), format!("{:?}", self.labels), format!("{:?}", self.assignee), if let Some(assignees) = &self.assignees { format!("{:?}", assignees) } else { String::new() }, format!("{:?}", self.milestone), format!("{:?}", self.locked), if let Some(active_lock_reason) = &self.active_lock_reason { format!("{:?}", active_lock_reason) } else { String::new() }, format!("{:?}", self.comments), if let Some(pull_request) = &self.pull_request { format!("{:?}", pull_request) } else { String::new() }, format!("{:?}", self.closed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(draft) = &self.draft { format!("{:?}", draft) } else { String::new() }, if let Some(closed_by) = &self.closed_by { format!("{:?}", closed_by) } else { String::new() }, if let Some(body_html) = &self.body_html { format!("{:?}", body_html) } else { String::new() }, if let Some(body_text) = &self.body_text { format!("{:?}", body_text) } else { String::new() }, if let Some(timeline_url) = &self.timeline_url { format!("{:?}", timeline_url) } else { String::new() }, if let Some(repository) = &self.repository { format!("{:?}", repository) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, format!("{:?}", self.author_association), if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "repository_url".to_string(), "labels_url".to_string(), "comments_url".to_string(), "events_url".to_string(), "html_url".to_string(), "number".to_string(), "state".to_string(), "state_reason".to_string(), "title".to_string(), "body".to_string(), "user".to_string(), "labels".to_string(), "assignee".to_string(), "assignees".to_string(), "milestone".to_string(), "locked".to_string(), "active_lock_reason".to_string(), "comments".to_string(), "pull_request".to_string(), "closed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "draft".to_string(), "closed_by".to_string(), "body_html".to_string(), "body_text".to_string(), "timeline_url".to_string(), "repository".to_string(), "performed_via_github_app".to_string(), "author_association".to_string(), "reactions".to_string(), ] } } #[doc = "Comments provide a way for people to collaborate on an issue."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueComment { #[doc = "Unique identifier of the issue comment"] pub id: i64, pub node_id: String, #[doc = "URL for the issue comment"] pub url: url::Url, #[doc = "Contents of the issue comment"] #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_text: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_html: Option, pub html_url: url::Url, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub issue_url: url::Url, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for IssueComment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueComment { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), if let Some(body) = &self.body { format!("{:?}", body) } else { String::new() }, if let Some(body_text) = &self.body_text { format!("{:?}", body_text) } else { String::new() }, if let Some(body_html) = &self.body_html { format!("{:?}", body_html) } else { String::new() }, format!("{:?}", self.html_url), format!("{:?}", self.user), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.issue_url), format!("{:?}", self.author_association), if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "body".to_string(), "body_text".to_string(), "body_html".to_string(), "html_url".to_string(), "user".to_string(), "created_at".to_string(), "updated_at".to_string(), "issue_url".to_string(), "author_association".to_string(), "performed_via_github_app".to_string(), "reactions".to_string(), ] } } #[doc = "Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Event { pub id: String, #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, #[doc = "Actor"] pub actor: Actor, pub repo: Repo, #[doc = "Actor"] #[serde(default, skip_serializing_if = "Option::is_none")] pub org: Option, pub payload: Payload, pub public: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, } impl std::fmt::Display for Event { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Event { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ self.id.clone(), format!("{:?}", self.type_), format!("{:?}", self.actor), format!("{:?}", self.repo), if let Some(org) = &self.org { format!("{:?}", org) } else { String::new() }, format!("{:?}", self.payload), format!("{:?}", self.public), format!("{:?}", self.created_at), ] } fn headers() -> Vec { vec![ "id".to_string(), "type_".to_string(), "actor".to_string(), "repo".to_string(), "org".to_string(), "payload".to_string(), "public".to_string(), "created_at".to_string(), ] } } #[doc = "Hypermedia Link with Type"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct LinkWithType { pub href: String, #[serde(rename = "type")] pub type_: String, } impl std::fmt::Display for LinkWithType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for LinkWithType { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.href.clone(), self.type_.clone()] } fn headers() -> Vec { vec!["href".to_string(), "type_".to_string()] } } #[doc = "Feed"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Feed { pub timeline_url: String, pub user_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub current_user_public_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub current_user_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub current_user_actor_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub current_user_organization_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub current_user_organization_urls: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub security_advisories_url: Option, #[serde(rename = "_links")] pub links: Links, } impl std::fmt::Display for Feed { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Feed { const LENGTH: usize = 9; fn fields(&self) -> Vec { vec![ self.timeline_url.clone(), self.user_url.clone(), if let Some(current_user_public_url) = &self.current_user_public_url { format!("{:?}", current_user_public_url) } else { String::new() }, if let Some(current_user_url) = &self.current_user_url { format!("{:?}", current_user_url) } else { String::new() }, if let Some(current_user_actor_url) = &self.current_user_actor_url { format!("{:?}", current_user_actor_url) } else { String::new() }, if let Some(current_user_organization_url) = &self.current_user_organization_url { format!("{:?}", current_user_organization_url) } else { String::new() }, if let Some(current_user_organization_urls) = &self.current_user_organization_urls { format!("{:?}", current_user_organization_urls) } else { String::new() }, if let Some(security_advisories_url) = &self.security_advisories_url { format!("{:?}", security_advisories_url) } else { String::new() }, format!("{:?}", self.links), ] } fn headers() -> Vec { vec![ "timeline_url".to_string(), "user_url".to_string(), "current_user_public_url".to_string(), "current_user_url".to_string(), "current_user_actor_url".to_string(), "current_user_organization_url".to_string(), "current_user_organization_urls".to_string(), "security_advisories_url".to_string(), "links".to_string(), ] } } #[doc = "Base Gist"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BaseGist { pub url: url::Url, pub forks_url: url::Url, pub commits_url: url::Url, pub id: String, pub node_id: String, pub git_pull_url: url::Url, pub git_push_url: url::Url, pub html_url: url::Url, pub files: std::collections::HashMap, pub public: bool, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub comments: i64, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, pub comments_url: url::Url, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub truncated: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub history: Option>, } impl std::fmt::Display for BaseGist { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BaseGist { const LENGTH: usize = 20; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.forks_url), format!("{:?}", self.commits_url), self.id.clone(), self.node_id.clone(), format!("{:?}", self.git_pull_url), format!("{:?}", self.git_push_url), format!("{:?}", self.html_url), format!("{:?}", self.files), format!("{:?}", self.public), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.description), format!("{:?}", self.comments), format!("{:?}", self.user), format!("{:?}", self.comments_url), if let Some(owner) = &self.owner { format!("{:?}", owner) } else { String::new() }, if let Some(truncated) = &self.truncated { format!("{:?}", truncated) } else { String::new() }, if let Some(forks) = &self.forks { format!("{:?}", forks) } else { String::new() }, if let Some(history) = &self.history { format!("{:?}", history) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "forks_url".to_string(), "commits_url".to_string(), "id".to_string(), "node_id".to_string(), "git_pull_url".to_string(), "git_push_url".to_string(), "html_url".to_string(), "files".to_string(), "public".to_string(), "created_at".to_string(), "updated_at".to_string(), "description".to_string(), "comments".to_string(), "user".to_string(), "comments_url".to_string(), "owner".to_string(), "truncated".to_string(), "forks".to_string(), "history".to_string(), ] } } #[doc = "Public User"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PublicUser { pub login: String, pub id: i64, pub node_id: String, pub avatar_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub html_url: url::Url, pub followers_url: url::Url, pub following_url: String, pub gists_url: String, pub starred_url: String, pub subscriptions_url: url::Url, pub organizations_url: url::Url, pub repos_url: url::Url, pub events_url: String, pub received_events_url: url::Url, #[serde(rename = "type")] pub type_: String, pub site_admin: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub company: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub blog: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub location: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub hireable: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub bio: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub twitter_username: Option, pub public_repos: i64, pub public_gists: i64, pub followers: i64, pub following: i64, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub plan: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub suspended_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub private_gists: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub total_private_repos: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub owned_private_repos: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub disk_usage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub collaborators: Option, } impl std::fmt::Display for PublicUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PublicUser { const LENGTH: usize = 39; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.followers_url), self.following_url.clone(), self.gists_url.clone(), self.starred_url.clone(), format!("{:?}", self.subscriptions_url), format!("{:?}", self.organizations_url), format!("{:?}", self.repos_url), self.events_url.clone(), format!("{:?}", self.received_events_url), self.type_.clone(), format!("{:?}", self.site_admin), format!("{:?}", self.name), format!("{:?}", self.company), format!("{:?}", self.blog), format!("{:?}", self.location), format!("{:?}", self.email), format!("{:?}", self.hireable), format!("{:?}", self.bio), if let Some(twitter_username) = &self.twitter_username { format!("{:?}", twitter_username) } else { String::new() }, format!("{:?}", self.public_repos), format!("{:?}", self.public_gists), format!("{:?}", self.followers), format!("{:?}", self.following), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(plan) = &self.plan { format!("{:?}", plan) } else { String::new() }, if let Some(suspended_at) = &self.suspended_at { format!("{:?}", suspended_at) } else { String::new() }, if let Some(private_gists) = &self.private_gists { format!("{:?}", private_gists) } else { String::new() }, if let Some(total_private_repos) = &self.total_private_repos { format!("{:?}", total_private_repos) } else { String::new() }, if let Some(owned_private_repos) = &self.owned_private_repos { format!("{:?}", owned_private_repos) } else { String::new() }, if let Some(disk_usage) = &self.disk_usage { format!("{:?}", disk_usage) } else { String::new() }, if let Some(collaborators) = &self.collaborators { format!("{:?}", collaborators) } else { String::new() }, ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "name".to_string(), "company".to_string(), "blog".to_string(), "location".to_string(), "email".to_string(), "hireable".to_string(), "bio".to_string(), "twitter_username".to_string(), "public_repos".to_string(), "public_gists".to_string(), "followers".to_string(), "following".to_string(), "created_at".to_string(), "updated_at".to_string(), "plan".to_string(), "suspended_at".to_string(), "private_gists".to_string(), "total_private_repos".to_string(), "owned_private_repos".to_string(), "disk_usage".to_string(), "collaborators".to_string(), ] } } #[doc = "Gist History"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GistHistory { #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub version: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub committed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub change_status: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, } impl std::fmt::Display for GistHistory { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GistHistory { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ if let Some(user) = &self.user { format!("{:?}", user) } else { String::new() }, if let Some(version) = &self.version { format!("{:?}", version) } else { String::new() }, if let Some(committed_at) = &self.committed_at { format!("{:?}", committed_at) } else { String::new() }, if let Some(change_status) = &self.change_status { format!("{:?}", change_status) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "user".to_string(), "version".to_string(), "committed_at".to_string(), "change_status".to_string(), "url".to_string(), ] } } #[doc = "Gist Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GistSimple { #[serde(default, skip_serializing_if = "Option::is_none")] pub forks: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub history: Option>, #[doc = "Gist"] #[serde(default, skip_serializing_if = "Option::is_none")] pub fork_of: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commits_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub node_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_pull_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_push_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub files: Option>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub public: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub comments: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub comments_url: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub truncated: Option, } impl std::fmt::Display for GistSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GistSimple { const LENGTH: usize = 21; fn fields(&self) -> Vec { vec![ if let Some(forks) = &self.forks { format!("{:?}", forks) } else { String::new() }, if let Some(history) = &self.history { format!("{:?}", history) } else { String::new() }, if let Some(fork_of) = &self.fork_of { format!("{:?}", fork_of) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(forks_url) = &self.forks_url { format!("{:?}", forks_url) } else { String::new() }, if let Some(commits_url) = &self.commits_url { format!("{:?}", commits_url) } else { String::new() }, if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(node_id) = &self.node_id { format!("{:?}", node_id) } else { String::new() }, if let Some(git_pull_url) = &self.git_pull_url { format!("{:?}", git_pull_url) } else { String::new() }, if let Some(git_push_url) = &self.git_push_url { format!("{:?}", git_push_url) } else { String::new() }, if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, if let Some(files) = &self.files { format!("{:?}", files) } else { String::new() }, if let Some(public) = &self.public { format!("{:?}", public) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, if let Some(description) = &self.description { format!("{:?}", description) } else { String::new() }, if let Some(comments) = &self.comments { format!("{:?}", comments) } else { String::new() }, if let Some(user) = &self.user { format!("{:?}", user) } else { String::new() }, if let Some(comments_url) = &self.comments_url { format!("{:?}", comments_url) } else { String::new() }, if let Some(owner) = &self.owner { format!("{:?}", owner) } else { String::new() }, if let Some(truncated) = &self.truncated { format!("{:?}", truncated) } else { String::new() }, ] } fn headers() -> Vec { vec![ "forks".to_string(), "history".to_string(), "fork_of".to_string(), "url".to_string(), "forks_url".to_string(), "commits_url".to_string(), "id".to_string(), "node_id".to_string(), "git_pull_url".to_string(), "git_push_url".to_string(), "html_url".to_string(), "files".to_string(), "public".to_string(), "created_at".to_string(), "updated_at".to_string(), "description".to_string(), "comments".to_string(), "user".to_string(), "comments_url".to_string(), "owner".to_string(), "truncated".to_string(), ] } } #[doc = "A comment made to a gist."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GistComment { pub id: i64, pub node_id: String, pub url: url::Url, #[doc = "The comment text."] pub body: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, } impl std::fmt::Display for GistComment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GistComment { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), self.body.clone(), format!("{:?}", self.user), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.author_association), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "body".to_string(), "user".to_string(), "created_at".to_string(), "updated_at".to_string(), "author_association".to_string(), ] } } #[doc = "Gist Commit"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GistCommit { pub url: url::Url, pub version: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, pub change_status: ChangeStatus, pub committed_at: chrono::DateTime, } impl std::fmt::Display for GistCommit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GistCommit { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), self.version.clone(), format!("{:?}", self.user), format!("{:?}", self.change_status), format!("{:?}", self.committed_at), ] } fn headers() -> Vec { vec![ "url".to_string(), "version".to_string(), "user".to_string(), "change_status".to_string(), "committed_at".to_string(), ] } } #[doc = "Gitignore Template"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GitignoreTemplate { pub name: String, pub source: String, } impl std::fmt::Display for GitignoreTemplate { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GitignoreTemplate { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.name.clone(), self.source.clone()] } fn headers() -> Vec { vec!["name".to_string(), "source".to_string()] } } #[doc = "License Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct LicenseSimple { pub key: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub spdx_id: Option, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for LicenseSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for LicenseSimple { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.key.clone(), self.name.clone(), format!("{:?}", self.url), format!("{:?}", self.spdx_id), self.node_id.clone(), if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "key".to_string(), "name".to_string(), "url".to_string(), "spdx_id".to_string(), "node_id".to_string(), "html_url".to_string(), ] } } #[doc = "License"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct License { pub key: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub spdx_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, pub node_id: String, pub html_url: url::Url, pub description: String, pub implementation: String, pub permissions: Vec, pub conditions: Vec, pub limitations: Vec, pub body: String, pub featured: bool, } impl std::fmt::Display for License { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for License { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ self.key.clone(), self.name.clone(), format!("{:?}", self.spdx_id), format!("{:?}", self.url), self.node_id.clone(), format!("{:?}", self.html_url), self.description.clone(), self.implementation.clone(), format!("{:?}", self.permissions), format!("{:?}", self.conditions), format!("{:?}", self.limitations), self.body.clone(), format!("{:?}", self.featured), ] } fn headers() -> Vec { vec![ "key".to_string(), "name".to_string(), "spdx_id".to_string(), "url".to_string(), "node_id".to_string(), "html_url".to_string(), "description".to_string(), "implementation".to_string(), "permissions".to_string(), "conditions".to_string(), "limitations".to_string(), "body".to_string(), "featured".to_string(), ] } } #[doc = "Marketplace Listing Plan"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct MarketplaceListingPlan { pub url: url::Url, pub accounts_url: url::Url, pub id: i64, pub number: i64, pub name: String, pub description: String, pub monthly_price_in_cents: i64, pub yearly_price_in_cents: i64, pub price_model: String, pub has_free_trial: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub unit_name: Option, pub state: String, pub bullets: Vec, } impl std::fmt::Display for MarketplaceListingPlan { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for MarketplaceListingPlan { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.accounts_url), format!("{:?}", self.id), format!("{:?}", self.number), self.name.clone(), self.description.clone(), format!("{:?}", self.monthly_price_in_cents), format!("{:?}", self.yearly_price_in_cents), self.price_model.clone(), format!("{:?}", self.has_free_trial), format!("{:?}", self.unit_name), self.state.clone(), format!("{:?}", self.bullets), ] } fn headers() -> Vec { vec![ "url".to_string(), "accounts_url".to_string(), "id".to_string(), "number".to_string(), "name".to_string(), "description".to_string(), "monthly_price_in_cents".to_string(), "yearly_price_in_cents".to_string(), "price_model".to_string(), "has_free_trial".to_string(), "unit_name".to_string(), "state".to_string(), "bullets".to_string(), ] } } #[doc = "Marketplace Purchase"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct MarketplacePurchase { pub url: String, #[serde(rename = "type")] pub type_: String, pub id: i64, pub login: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_billing_email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub marketplace_pending_change: Option, pub marketplace_purchase: MarketplacePurchase, } impl std::fmt::Display for MarketplacePurchase { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for MarketplacePurchase { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ self.url.clone(), self.type_.clone(), format!("{:?}", self.id), self.login.clone(), if let Some(organization_billing_email) = &self.organization_billing_email { format!("{:?}", organization_billing_email) } else { String::new() }, if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(marketplace_pending_change) = &self.marketplace_pending_change { format!("{:?}", marketplace_pending_change) } else { String::new() }, format!("{:?}", self.marketplace_purchase), ] } fn headers() -> Vec { vec![ "url".to_string(), "type_".to_string(), "id".to_string(), "login".to_string(), "organization_billing_email".to_string(), "email".to_string(), "marketplace_pending_change".to_string(), "marketplace_purchase".to_string(), ] } } #[doc = "Api Overview"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ApiOverview { pub verifiable_password_authentication: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub ssh_key_fingerprints: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub ssh_keys: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub hooks: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub web: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub api: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub git: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub packages: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub pages: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub importer: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub actions: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub dependabot: Option>, } impl std::fmt::Display for ApiOverview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ApiOverview { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ format!("{:?}", self.verifiable_password_authentication), if let Some(ssh_key_fingerprints) = &self.ssh_key_fingerprints { format!("{:?}", ssh_key_fingerprints) } else { String::new() }, if let Some(ssh_keys) = &self.ssh_keys { format!("{:?}", ssh_keys) } else { String::new() }, if let Some(hooks) = &self.hooks { format!("{:?}", hooks) } else { String::new() }, if let Some(web) = &self.web { format!("{:?}", web) } else { String::new() }, if let Some(api) = &self.api { format!("{:?}", api) } else { String::new() }, if let Some(git) = &self.git { format!("{:?}", git) } else { String::new() }, if let Some(packages) = &self.packages { format!("{:?}", packages) } else { String::new() }, if let Some(pages) = &self.pages { format!("{:?}", pages) } else { String::new() }, if let Some(importer) = &self.importer { format!("{:?}", importer) } else { String::new() }, if let Some(actions) = &self.actions { format!("{:?}", actions) } else { String::new() }, if let Some(dependabot) = &self.dependabot { format!("{:?}", dependabot) } else { String::new() }, ] } fn headers() -> Vec { vec![ "verifiable_password_authentication".to_string(), "ssh_key_fingerprints".to_string(), "ssh_keys".to_string(), "hooks".to_string(), "web".to_string(), "api".to_string(), "git".to_string(), "packages".to_string(), "pages".to_string(), "importer".to_string(), "actions".to_string(), "dependabot".to_string(), ] } } #[doc = "A git repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableRepository { #[doc = "Unique identifier of the repository"] pub id: i64, pub node_id: String, #[doc = "The name of the repository."] pub name: String, pub full_name: String, #[doc = "License Simple"] #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization: Option, pub forks: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[doc = "Simple User"] pub owner: SimpleUser, #[doc = "Whether the repository is private or public."] pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, pub git_url: String, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, pub ssh_url: String, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, pub clone_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, pub svn_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, pub forks_count: i64, pub stargazers_count: i64, pub watchers_count: i64, pub size: i64, #[doc = "The default branch of the repository."] pub default_branch: String, pub open_issues_count: i64, #[doc = "Whether this repository acts as a template that can be used to generate new repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, #[doc = "Whether issues are enabled."] pub has_issues: bool, #[doc = "Whether projects are enabled."] pub has_projects: bool, #[doc = "Whether the wiki is enabled."] pub has_wiki: bool, pub has_pages: bool, #[doc = "Whether downloads are enabled."] pub has_downloads: bool, #[doc = "Whether the repository is archived."] pub archived: bool, #[doc = "Returns whether or not this repository disabled."] pub disabled: bool, #[doc = "The repository visibility: public, private, or internal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "Whether to allow rebase merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_rebase_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[doc = "Whether to allow squash merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_squash_merge: Option, #[doc = "Whether to allow Auto-merge to be used on pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_auto_merge: Option, #[doc = "Whether to delete head branches when pull requests are merged"] #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[doc = "Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_update_branch: Option, #[doc = "Whether a squash merge commit can use the pull request title as default."] #[serde(default, skip_serializing_if = "Option::is_none")] pub use_squash_pr_title_as_default: Option, #[doc = "Whether to allow merge commits for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_merge_commit: Option, #[doc = "Whether to allow forking this repo"] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscribers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub network_count: Option, pub open_issues: i64, pub watchers: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub master_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub starred_at: Option, } impl std::fmt::Display for NullableRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableRepository { const LENGTH: usize = 92; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.license), if let Some(organization) = &self.organization { format!("{:?}", organization) } else { String::new() }, format!("{:?}", self.forks), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), self.git_url.clone(), self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), self.ssh_url.clone(), format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), self.clone_url.clone(), format!("{:?}", self.mirror_url), format!("{:?}", self.hooks_url), format!("{:?}", self.svn_url), format!("{:?}", self.homepage), format!("{:?}", self.language), format!("{:?}", self.forks_count), format!("{:?}", self.stargazers_count), format!("{:?}", self.watchers_count), format!("{:?}", self.size), self.default_branch.clone(), format!("{:?}", self.open_issues_count), if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, format!("{:?}", self.has_issues), format!("{:?}", self.has_projects), format!("{:?}", self.has_wiki), format!("{:?}", self.has_pages), format!("{:?}", self.has_downloads), format!("{:?}", self.archived), format!("{:?}", self.disabled), if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, format!("{:?}", self.pushed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(allow_rebase_merge) = &self.allow_rebase_merge { format!("{:?}", allow_rebase_merge) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(allow_squash_merge) = &self.allow_squash_merge { format!("{:?}", allow_squash_merge) } else { String::new() }, if let Some(allow_auto_merge) = &self.allow_auto_merge { format!("{:?}", allow_auto_merge) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(allow_update_branch) = &self.allow_update_branch { format!("{:?}", allow_update_branch) } else { String::new() }, if let Some(use_squash_pr_title_as_default) = &self.use_squash_pr_title_as_default { format!("{:?}", use_squash_pr_title_as_default) } else { String::new() }, if let Some(allow_merge_commit) = &self.allow_merge_commit { format!("{:?}", allow_merge_commit) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, if let Some(subscribers_count) = &self.subscribers_count { format!("{:?}", subscribers_count) } else { String::new() }, if let Some(network_count) = &self.network_count { format!("{:?}", network_count) } else { String::new() }, format!("{:?}", self.open_issues), format!("{:?}", self.watchers), if let Some(master_branch) = &self.master_branch { format!("{:?}", master_branch) } else { String::new() }, if let Some(starred_at) = &self.starred_at { format!("{:?}", starred_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "license".to_string(), "organization".to_string(), "forks".to_string(), "permissions".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "allow_rebase_merge".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "allow_squash_merge".to_string(), "allow_auto_merge".to_string(), "delete_branch_on_merge".to_string(), "allow_update_branch".to_string(), "use_squash_pr_title_as_default".to_string(), "allow_merge_commit".to_string(), "allow_forking".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "open_issues".to_string(), "watchers".to_string(), "master_branch".to_string(), "starred_at".to_string(), ] } } #[doc = "Minimal Repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct MinimalRepository { pub id: i64, pub node_id: String, pub name: String, pub full_name: String, #[doc = "Simple User"] pub owner: SimpleUser, pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub ssh_url: Option, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub clone_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub svn_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub stargazers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub watchers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub size: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub default_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub open_issues_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_issues: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_projects: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_wiki: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_pages: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_downloads: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub archived: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub disabled: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub role_name: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscribers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub network_count: Option, #[doc = "Code Of Conduct"] #[serde(default, skip_serializing_if = "Option::is_none")] pub code_of_conduct: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub open_issues: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub watchers: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, } impl std::fmt::Display for MinimalRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for MinimalRepository { const LENGTH: usize = 85; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), if let Some(git_url) = &self.git_url { format!("{:?}", git_url) } else { String::new() }, self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), if let Some(ssh_url) = &self.ssh_url { format!("{:?}", ssh_url) } else { String::new() }, format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), if let Some(clone_url) = &self.clone_url { format!("{:?}", clone_url) } else { String::new() }, if let Some(mirror_url) = &self.mirror_url { format!("{:?}", mirror_url) } else { String::new() }, format!("{:?}", self.hooks_url), if let Some(svn_url) = &self.svn_url { format!("{:?}", svn_url) } else { String::new() }, if let Some(homepage) = &self.homepage { format!("{:?}", homepage) } else { String::new() }, if let Some(language) = &self.language { format!("{:?}", language) } else { String::new() }, if let Some(forks_count) = &self.forks_count { format!("{:?}", forks_count) } else { String::new() }, if let Some(stargazers_count) = &self.stargazers_count { format!("{:?}", stargazers_count) } else { String::new() }, if let Some(watchers_count) = &self.watchers_count { format!("{:?}", watchers_count) } else { String::new() }, if let Some(size) = &self.size { format!("{:?}", size) } else { String::new() }, if let Some(default_branch) = &self.default_branch { format!("{:?}", default_branch) } else { String::new() }, if let Some(open_issues_count) = &self.open_issues_count { format!("{:?}", open_issues_count) } else { String::new() }, if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, if let Some(has_issues) = &self.has_issues { format!("{:?}", has_issues) } else { String::new() }, if let Some(has_projects) = &self.has_projects { format!("{:?}", has_projects) } else { String::new() }, if let Some(has_wiki) = &self.has_wiki { format!("{:?}", has_wiki) } else { String::new() }, if let Some(has_pages) = &self.has_pages { format!("{:?}", has_pages) } else { String::new() }, if let Some(has_downloads) = &self.has_downloads { format!("{:?}", has_downloads) } else { String::new() }, if let Some(archived) = &self.archived { format!("{:?}", archived) } else { String::new() }, if let Some(disabled) = &self.disabled { format!("{:?}", disabled) } else { String::new() }, if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, if let Some(pushed_at) = &self.pushed_at { format!("{:?}", pushed_at) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(role_name) = &self.role_name { format!("{:?}", role_name) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(subscribers_count) = &self.subscribers_count { format!("{:?}", subscribers_count) } else { String::new() }, if let Some(network_count) = &self.network_count { format!("{:?}", network_count) } else { String::new() }, if let Some(code_of_conduct) = &self.code_of_conduct { format!("{:?}", code_of_conduct) } else { String::new() }, if let Some(license) = &self.license { format!("{:?}", license) } else { String::new() }, if let Some(forks) = &self.forks { format!("{:?}", forks) } else { String::new() }, if let Some(open_issues) = &self.open_issues { format!("{:?}", open_issues) } else { String::new() }, if let Some(watchers) = &self.watchers { format!("{:?}", watchers) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "permissions".to_string(), "role_name".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "delete_branch_on_merge".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "code_of_conduct".to_string(), "license".to_string(), "forks".to_string(), "open_issues".to_string(), "watchers".to_string(), "allow_forking".to_string(), ] } } #[doc = "Thread"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Thread { pub id: String, #[doc = "Minimal Repository"] pub repository: MinimalRepository, pub subject: Subject, pub reason: String, pub unread: bool, pub updated_at: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub last_read_at: Option, pub url: String, pub subscription_url: String, } impl std::fmt::Display for Thread { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Thread { const LENGTH: usize = 9; fn fields(&self) -> Vec { vec![ self.id.clone(), format!("{:?}", self.repository), format!("{:?}", self.subject), self.reason.clone(), format!("{:?}", self.unread), self.updated_at.clone(), format!("{:?}", self.last_read_at), self.url.clone(), self.subscription_url.clone(), ] } fn headers() -> Vec { vec![ "id".to_string(), "repository".to_string(), "subject".to_string(), "reason".to_string(), "unread".to_string(), "updated_at".to_string(), "last_read_at".to_string(), "url".to_string(), "subscription_url".to_string(), ] } } #[doc = "Thread Subscription"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ThreadSubscription { pub subscribed: bool, pub ignored: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub reason: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub thread_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub repository_url: Option, } impl std::fmt::Display for ThreadSubscription { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ThreadSubscription { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.subscribed), format!("{:?}", self.ignored), format!("{:?}", self.reason), format!("{:?}", self.created_at), format!("{:?}", self.url), if let Some(thread_url) = &self.thread_url { format!("{:?}", thread_url) } else { String::new() }, if let Some(repository_url) = &self.repository_url { format!("{:?}", repository_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "subscribed".to_string(), "ignored".to_string(), "reason".to_string(), "created_at".to_string(), "url".to_string(), "thread_url".to_string(), "repository_url".to_string(), ] } } #[doc = "Custom repository roles created by organization administrators"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationCustomRepositoryRole { pub id: i64, pub name: String, } impl std::fmt::Display for OrganizationCustomRepositoryRole { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationCustomRepositoryRole { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.id), self.name.clone()] } fn headers() -> Vec { vec!["id".to_string(), "name".to_string()] } } #[doc = "Secrets for a GitHub Codespace."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodespacesOrgSecret { #[doc = "The name of the secret"] pub name: String, #[doc = "Secret created at"] pub created_at: chrono::DateTime, #[doc = "Secret last updated at"] pub updated_at: chrono::DateTime, #[doc = "The type of repositories in the organization that the secret is visible to"] pub visibility: Visibility, #[doc = "API URL at which the list of repositories this secret is vicible can be retrieved"] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_repositories_url: Option, } impl std::fmt::Display for CodespacesOrgSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodespacesOrgSecret { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.visibility), if let Some(selected_repositories_url) = &self.selected_repositories_url { format!("{:?}", selected_repositories_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), "visibility".to_string(), "selected_repositories_url".to_string(), ] } } #[doc = "Organization Full"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationFull { pub login: String, pub id: i64, pub node_id: String, pub url: url::Url, pub repos_url: url::Url, pub events_url: url::Url, pub hooks_url: String, pub issues_url: String, pub members_url: String, pub public_members_url: String, pub avatar_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub company: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub blog: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub location: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub twitter_username: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub is_verified: Option, pub has_organization_projects: bool, pub has_repository_projects: bool, pub public_repos: i64, pub public_gists: i64, pub followers: i64, pub following: i64, pub html_url: url::Url, pub created_at: chrono::DateTime, #[serde(rename = "type")] pub type_: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub total_private_repos: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub owned_private_repos: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub private_gists: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub disk_usage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub collaborators: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub billing_email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub plan: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub default_repository_permission: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_repositories: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub two_factor_requirement_enabled: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_allowed_repository_creation_type: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_public_repositories: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_private_repositories: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_internal_repositories: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_pages: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_public_pages: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_create_private_pages: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub members_can_fork_private_repositories: Option, pub updated_at: chrono::DateTime, } impl std::fmt::Display for OrganizationFull { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationFull { const LENGTH: usize = 47; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.repos_url), format!("{:?}", self.events_url), self.hooks_url.clone(), self.issues_url.clone(), self.members_url.clone(), self.public_members_url.clone(), self.avatar_url.clone(), format!("{:?}", self.description), if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(company) = &self.company { format!("{:?}", company) } else { String::new() }, if let Some(blog) = &self.blog { format!("{:?}", blog) } else { String::new() }, if let Some(location) = &self.location { format!("{:?}", location) } else { String::new() }, if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(twitter_username) = &self.twitter_username { format!("{:?}", twitter_username) } else { String::new() }, if let Some(is_verified) = &self.is_verified { format!("{:?}", is_verified) } else { String::new() }, format!("{:?}", self.has_organization_projects), format!("{:?}", self.has_repository_projects), format!("{:?}", self.public_repos), format!("{:?}", self.public_gists), format!("{:?}", self.followers), format!("{:?}", self.following), format!("{:?}", self.html_url), format!("{:?}", self.created_at), self.type_.clone(), if let Some(total_private_repos) = &self.total_private_repos { format!("{:?}", total_private_repos) } else { String::new() }, if let Some(owned_private_repos) = &self.owned_private_repos { format!("{:?}", owned_private_repos) } else { String::new() }, if let Some(private_gists) = &self.private_gists { format!("{:?}", private_gists) } else { String::new() }, if let Some(disk_usage) = &self.disk_usage { format!("{:?}", disk_usage) } else { String::new() }, if let Some(collaborators) = &self.collaborators { format!("{:?}", collaborators) } else { String::new() }, if let Some(billing_email) = &self.billing_email { format!("{:?}", billing_email) } else { String::new() }, if let Some(plan) = &self.plan { format!("{:?}", plan) } else { String::new() }, if let Some(default_repository_permission) = &self.default_repository_permission { format!("{:?}", default_repository_permission) } else { String::new() }, if let Some(members_can_create_repositories) = &self.members_can_create_repositories { format!("{:?}", members_can_create_repositories) } else { String::new() }, if let Some(two_factor_requirement_enabled) = &self.two_factor_requirement_enabled { format!("{:?}", two_factor_requirement_enabled) } else { String::new() }, if let Some(members_allowed_repository_creation_type) = &self.members_allowed_repository_creation_type { format!("{:?}", members_allowed_repository_creation_type) } else { String::new() }, if let Some(members_can_create_public_repositories) = &self.members_can_create_public_repositories { format!("{:?}", members_can_create_public_repositories) } else { String::new() }, if let Some(members_can_create_private_repositories) = &self.members_can_create_private_repositories { format!("{:?}", members_can_create_private_repositories) } else { String::new() }, if let Some(members_can_create_internal_repositories) = &self.members_can_create_internal_repositories { format!("{:?}", members_can_create_internal_repositories) } else { String::new() }, if let Some(members_can_create_pages) = &self.members_can_create_pages { format!("{:?}", members_can_create_pages) } else { String::new() }, if let Some(members_can_create_public_pages) = &self.members_can_create_public_pages { format!("{:?}", members_can_create_public_pages) } else { String::new() }, if let Some(members_can_create_private_pages) = &self.members_can_create_private_pages { format!("{:?}", members_can_create_private_pages) } else { String::new() }, if let Some(members_can_fork_private_repositories) = &self.members_can_fork_private_repositories { format!("{:?}", members_can_fork_private_repositories) } else { String::new() }, format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "node_id".to_string(), "url".to_string(), "repos_url".to_string(), "events_url".to_string(), "hooks_url".to_string(), "issues_url".to_string(), "members_url".to_string(), "public_members_url".to_string(), "avatar_url".to_string(), "description".to_string(), "name".to_string(), "company".to_string(), "blog".to_string(), "location".to_string(), "email".to_string(), "twitter_username".to_string(), "is_verified".to_string(), "has_organization_projects".to_string(), "has_repository_projects".to_string(), "public_repos".to_string(), "public_gists".to_string(), "followers".to_string(), "following".to_string(), "html_url".to_string(), "created_at".to_string(), "type_".to_string(), "total_private_repos".to_string(), "owned_private_repos".to_string(), "private_gists".to_string(), "disk_usage".to_string(), "collaborators".to_string(), "billing_email".to_string(), "plan".to_string(), "default_repository_permission".to_string(), "members_can_create_repositories".to_string(), "two_factor_requirement_enabled".to_string(), "members_allowed_repository_creation_type".to_string(), "members_can_create_public_repositories".to_string(), "members_can_create_private_repositories".to_string(), "members_can_create_internal_repositories".to_string(), "members_can_create_pages".to_string(), "members_can_create_public_pages".to_string(), "members_can_create_private_pages".to_string(), "members_can_fork_private_repositories".to_string(), "updated_at".to_string(), ] } } #[doc = "GitHub Actions Cache Usage by repository."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsCacheUsageByRepository { #[doc = "The repository owner and name for the cache usage being shown."] pub full_name: String, #[doc = "The sum of the size in bytes of all the active cache items in the repository."] pub active_caches_size_in_bytes: i64, #[doc = "The number of active caches in the repository."] pub active_caches_count: i64, } impl std::fmt::Display for ActionsCacheUsageByRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsCacheUsageByRepository { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.full_name.clone(), format!("{:?}", self.active_caches_size_in_bytes), format!("{:?}", self.active_caches_count), ] } fn headers() -> Vec { vec![ "full_name".to_string(), "active_caches_size_in_bytes".to_string(), "active_caches_count".to_string(), ] } } #[doc = "Actions OIDC Subject customization"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OidcCustomSub { pub include_claim_keys: Vec, } impl std::fmt::Display for OidcCustomSub { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OidcCustomSub { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![format!("{:?}", self.include_claim_keys)] } fn headers() -> Vec { vec!["include_claim_keys".to_string()] } } #[doc = "An object without any properties."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct EmptyObject {} impl std::fmt::Display for EmptyObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for EmptyObject { const LENGTH: usize = 0; fn fields(&self) -> Vec { vec![] } fn headers() -> Vec { vec![] } } #[doc = "The policy that controls the repositories in the organization that are allowed to run GitHub Actions."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum EnabledRepositories { #[serde(rename = "all")] #[display("all")] All, #[serde(rename = "none")] #[display("none")] None, #[serde(rename = "selected")] #[display("selected")] Selected, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsOrganizationPermissions { #[doc = "The policy that controls the repositories in the organization that are allowed to run GitHub Actions."] pub enabled_repositories: EnabledRepositories, #[doc = "The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_repositories_url: Option, #[doc = "The permissions policy that controls the actions and reusable workflows that are allowed to run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allowed_actions: Option, #[doc = "The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_actions_url: Option, } impl std::fmt::Display for ActionsOrganizationPermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsOrganizationPermissions { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.enabled_repositories), if let Some(selected_repositories_url) = &self.selected_repositories_url { format!("{:?}", selected_repositories_url) } else { String::new() }, if let Some(allowed_actions) = &self.allowed_actions { format!("{:?}", allowed_actions) } else { String::new() }, if let Some(selected_actions_url) = &self.selected_actions_url { format!("{:?}", selected_actions_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "enabled_repositories".to_string(), "selected_repositories_url".to_string(), "allowed_actions".to_string(), "selected_actions_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RunnerGroupsOrg { pub id: f64, pub name: String, pub visibility: String, pub default: bool, #[doc = "Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected`"] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_repositories_url: Option, pub runners_url: String, pub inherited: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub inherited_allows_public_repositories: Option, pub allows_public_repositories: bool, #[doc = "If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified."] #[serde(default, skip_serializing_if = "Option::is_none")] pub workflow_restrictions_read_only: Option, #[doc = "If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array."] #[serde(default, skip_serializing_if = "Option::is_none")] pub restricted_to_workflows: Option, #[doc = "List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_workflows: Option>, } impl std::fmt::Display for RunnerGroupsOrg { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RunnerGroupsOrg { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), self.visibility.clone(), format!("{:?}", self.default), if let Some(selected_repositories_url) = &self.selected_repositories_url { format!("{:?}", selected_repositories_url) } else { String::new() }, self.runners_url.clone(), format!("{:?}", self.inherited), if let Some(inherited_allows_public_repositories) = &self.inherited_allows_public_repositories { format!("{:?}", inherited_allows_public_repositories) } else { String::new() }, format!("{:?}", self.allows_public_repositories), if let Some(workflow_restrictions_read_only) = &self.workflow_restrictions_read_only { format!("{:?}", workflow_restrictions_read_only) } else { String::new() }, if let Some(restricted_to_workflows) = &self.restricted_to_workflows { format!("{:?}", restricted_to_workflows) } else { String::new() }, if let Some(selected_workflows) = &self.selected_workflows { format!("{:?}", selected_workflows) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "visibility".to_string(), "default".to_string(), "selected_repositories_url".to_string(), "runners_url".to_string(), "inherited".to_string(), "inherited_allows_public_repositories".to_string(), "allows_public_repositories".to_string(), "workflow_restrictions_read_only".to_string(), "restricted_to_workflows".to_string(), "selected_workflows".to_string(), ] } } #[doc = "Secrets for GitHub Actions for an organization."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationActionsSecret { #[doc = "The name of the secret."] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Visibility of a secret"] pub visibility: Visibility, #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_repositories_url: Option, } impl std::fmt::Display for OrganizationActionsSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationActionsSecret { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.visibility), if let Some(selected_repositories_url) = &self.selected_repositories_url { format!("{:?}", selected_repositories_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), "visibility".to_string(), "selected_repositories_url".to_string(), ] } } #[doc = "The public key used for setting Actions Secrets."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsPublicKey { #[doc = "The identifier for the key."] pub key_id: String, #[doc = "The Base64 encoded public key."] pub key: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option, } impl std::fmt::Display for ActionsPublicKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsPublicKey { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.key_id.clone(), self.key.clone(), if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(title) = &self.title { format!("{:?}", title) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "key_id".to_string(), "key".to_string(), "id".to_string(), "url".to_string(), "title".to_string(), "created_at".to_string(), ] } } #[doc = "A description of the machine powering a codespace."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableCodespaceMachine { #[doc = "The name of the machine."] pub name: String, #[doc = "The display name of the machine includes cores, memory, and storage."] pub display_name: String, #[doc = "The operating system of the machine."] pub operating_system: String, #[doc = "How much storage is available to the codespace."] pub storage_in_bytes: i64, #[doc = "How much memory is available to the codespace."] pub memory_in_bytes: i64, #[doc = "How many cores are available to the codespace."] pub cpus: i64, #[doc = "Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be \"null\" if prebuilds are not supported or prebuild availability could not be determined. Value will be \"none\" if no prebuild is available. Latest values \"ready\" and \"in_progress\" indicate the prebuild availability status."] #[serde(default, skip_serializing_if = "Option::is_none")] pub prebuild_availability: Option, } impl std::fmt::Display for NullableCodespaceMachine { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableCodespaceMachine { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ self.name.clone(), self.display_name.clone(), self.operating_system.clone(), format!("{:?}", self.storage_in_bytes), format!("{:?}", self.memory_in_bytes), format!("{:?}", self.cpus), format!("{:?}", self.prebuild_availability), ] } fn headers() -> Vec { vec![ "name".to_string(), "display_name".to_string(), "operating_system".to_string(), "storage_in_bytes".to_string(), "memory_in_bytes".to_string(), "cpus".to_string(), "prebuild_availability".to_string(), ] } } #[doc = "A codespace."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Codespace { pub id: i64, #[doc = "Automatically generated name of this codespace."] pub name: String, #[doc = "Display name for this codespace."] #[serde(default, skip_serializing_if = "Option::is_none")] pub display_name: Option, #[doc = "UUID identifying this codespace's environment."] #[serde(default, skip_serializing_if = "Option::is_none")] pub environment_id: Option, #[doc = "Simple User"] pub owner: SimpleUser, #[doc = "Simple User"] pub billable_owner: SimpleUser, #[doc = "Minimal Repository"] pub repository: MinimalRepository, #[doc = "A description of the machine powering a codespace."] #[serde(default, skip_serializing_if = "Option::is_none")] pub machine: Option, #[doc = "Path to devcontainer.json from repo root used to create Codespace."] #[serde(default, skip_serializing_if = "Option::is_none")] pub devcontainer_path: Option, #[doc = "Whether the codespace was created from a prebuild."] #[serde(default, skip_serializing_if = "Option::is_none")] pub prebuild: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Last known time this codespace was started."] pub last_used_at: chrono::DateTime, #[doc = "State of this codespace."] pub state: State, #[doc = "API URL for this codespace."] pub url: url::Url, #[doc = "Details about the codespace's git repository."] pub git_status: GitStatus, #[doc = "The Azure region where this codespace is located."] pub location: Location, #[doc = "The number of minutes of inactivity after which this codespace will be automatically stopped."] #[serde(default, skip_serializing_if = "Option::is_none")] pub idle_timeout_minutes: Option, #[doc = "URL to access this codespace on the web."] pub web_url: url::Url, #[doc = "API URL to access available alternate machine types for this codespace."] pub machines_url: url::Url, #[doc = "API URL to start this codespace."] pub start_url: url::Url, #[doc = "API URL to stop this codespace."] pub stop_url: url::Url, #[doc = "API URL for the Pull Request associated with this codespace, if any."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pulls_url: Option, pub recent_folders: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub runtime_constraints: Option, #[doc = "Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pending_operation: Option, #[doc = "Text to show user when codespace is disabled by a pending operation"] #[serde(default, skip_serializing_if = "Option::is_none")] pub pending_operation_disabled_reason: Option, #[doc = "Text to show user when codespace idle timeout minutes has been overriden by an organization policy"] #[serde(default, skip_serializing_if = "Option::is_none")] pub idle_timeout_notice: Option, } impl std::fmt::Display for Codespace { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Codespace { const LENGTH: usize = 28; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), if let Some(display_name) = &self.display_name { format!("{:?}", display_name) } else { String::new() }, format!("{:?}", self.environment_id), format!("{:?}", self.owner), format!("{:?}", self.billable_owner), format!("{:?}", self.repository), format!("{:?}", self.machine), if let Some(devcontainer_path) = &self.devcontainer_path { format!("{:?}", devcontainer_path) } else { String::new() }, format!("{:?}", self.prebuild), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.last_used_at), format!("{:?}", self.state), format!("{:?}", self.url), format!("{:?}", self.git_status), format!("{:?}", self.location), format!("{:?}", self.idle_timeout_minutes), format!("{:?}", self.web_url), format!("{:?}", self.machines_url), format!("{:?}", self.start_url), format!("{:?}", self.stop_url), format!("{:?}", self.pulls_url), format!("{:?}", self.recent_folders), if let Some(runtime_constraints) = &self.runtime_constraints { format!("{:?}", runtime_constraints) } else { String::new() }, if let Some(pending_operation) = &self.pending_operation { format!("{:?}", pending_operation) } else { String::new() }, if let Some(pending_operation_disabled_reason) = &self.pending_operation_disabled_reason { format!("{:?}", pending_operation_disabled_reason) } else { String::new() }, if let Some(idle_timeout_notice) = &self.idle_timeout_notice { format!("{:?}", idle_timeout_notice) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "display_name".to_string(), "environment_id".to_string(), "owner".to_string(), "billable_owner".to_string(), "repository".to_string(), "machine".to_string(), "devcontainer_path".to_string(), "prebuild".to_string(), "created_at".to_string(), "updated_at".to_string(), "last_used_at".to_string(), "state".to_string(), "url".to_string(), "git_status".to_string(), "location".to_string(), "idle_timeout_minutes".to_string(), "web_url".to_string(), "machines_url".to_string(), "start_url".to_string(), "stop_url".to_string(), "pulls_url".to_string(), "recent_folders".to_string(), "runtime_constraints".to_string(), "pending_operation".to_string(), "pending_operation_disabled_reason".to_string(), "idle_timeout_notice".to_string(), ] } } #[doc = "Credential Authorization"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CredentialAuthorization { #[doc = "User login that owns the underlying credential."] pub login: String, #[doc = "Unique identifier for the credential."] pub credential_id: i64, #[doc = "Human-readable description of the credential type."] pub credential_type: String, #[doc = "Last eight characters of the credential. Only included in responses with credential_type of personal access token."] #[serde(default, skip_serializing_if = "Option::is_none")] pub token_last_eight: Option, #[doc = "Date when the credential was authorized for use."] pub credential_authorized_at: chrono::DateTime, #[doc = "List of oauth scopes the token has been granted."] #[serde(default, skip_serializing_if = "Option::is_none")] pub scopes: Option>, #[doc = "Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key."] #[serde(default, skip_serializing_if = "Option::is_none")] pub fingerprint: Option, #[doc = "Date when the credential was last accessed. May be null if it was never accessed"] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential_accessed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub authorized_credential_id: Option, #[doc = "The title given to the ssh key. This will only be present when the credential is an ssh key."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authorized_credential_title: Option, #[doc = "The note given to the token. This will only be present when the credential is a token."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authorized_credential_note: Option, #[doc = "The expiry for the token. This will only be present when the credential is a token."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authorized_credential_expires_at: Option>, } impl std::fmt::Display for CredentialAuthorization { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CredentialAuthorization { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.credential_id), self.credential_type.clone(), if let Some(token_last_eight) = &self.token_last_eight { format!("{:?}", token_last_eight) } else { String::new() }, format!("{:?}", self.credential_authorized_at), if let Some(scopes) = &self.scopes { format!("{:?}", scopes) } else { String::new() }, if let Some(fingerprint) = &self.fingerprint { format!("{:?}", fingerprint) } else { String::new() }, format!("{:?}", self.credential_accessed_at), format!("{:?}", self.authorized_credential_id), if let Some(authorized_credential_title) = &self.authorized_credential_title { format!("{:?}", authorized_credential_title) } else { String::new() }, if let Some(authorized_credential_note) = &self.authorized_credential_note { format!("{:?}", authorized_credential_note) } else { String::new() }, if let Some(authorized_credential_expires_at) = &self.authorized_credential_expires_at { format!("{:?}", authorized_credential_expires_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "login".to_string(), "credential_id".to_string(), "credential_type".to_string(), "token_last_eight".to_string(), "credential_authorized_at".to_string(), "scopes".to_string(), "fingerprint".to_string(), "credential_accessed_at".to_string(), "authorized_credential_id".to_string(), "authorized_credential_title".to_string(), "authorized_credential_note".to_string(), "authorized_credential_expires_at".to_string(), ] } } #[doc = "Secrets for GitHub Dependabot for an organization."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationDependabotSecret { #[doc = "The name of the secret."] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Visibility of a secret"] pub visibility: Visibility, #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_repositories_url: Option, } impl std::fmt::Display for OrganizationDependabotSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationDependabotSecret { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.visibility), if let Some(selected_repositories_url) = &self.selected_repositories_url { format!("{:?}", selected_repositories_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), "visibility".to_string(), "selected_repositories_url".to_string(), ] } } #[doc = "The public key used for setting Dependabot Secrets."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DependabotPublicKey { #[doc = "The identifier for the key."] pub key_id: String, #[doc = "The Base64 encoded public key."] pub key: String, } impl std::fmt::Display for DependabotPublicKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DependabotPublicKey { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.key_id.clone(), self.key.clone()] } fn headers() -> Vec { vec!["key_id".to_string(), "key".to_string()] } } #[doc = "Information about an external group's usage and its members"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ExternalGroup { #[doc = "The internal ID of the group"] pub group_id: i64, #[doc = "The display name for the group"] pub group_name: String, #[doc = "The date when the group was last updated_at"] #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option, #[doc = "An array of teams linked to this group"] pub teams: Vec, #[doc = "An array of external members linked to this group"] pub members: Vec, } impl std::fmt::Display for ExternalGroup { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ExternalGroup { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.group_id), self.group_name.clone(), if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, format!("{:?}", self.teams), format!("{:?}", self.members), ] } fn headers() -> Vec { vec![ "group_id".to_string(), "group_name".to_string(), "updated_at".to_string(), "teams".to_string(), "members".to_string(), ] } } #[doc = "A list of external groups available to be connected to a team"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ExternalGroups { #[doc = "An array of external groups available to be mapped to a team"] #[serde(default, skip_serializing_if = "Option::is_none")] pub groups: Option>, } impl std::fmt::Display for ExternalGroups { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ExternalGroups { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![if let Some(groups) = &self.groups { format!("{:?}", groups) } else { String::new() }] } fn headers() -> Vec { vec!["groups".to_string()] } } #[doc = "Organization Invitation"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrganizationInvitation { pub id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub login: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, pub role: String, pub created_at: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub failed_at: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub failed_reason: Option, #[doc = "Simple User"] pub inviter: SimpleUser, pub team_count: i64, pub node_id: String, pub invitation_teams_url: String, } impl std::fmt::Display for OrganizationInvitation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrganizationInvitation { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.login), format!("{:?}", self.email), self.role.clone(), self.created_at.clone(), if let Some(failed_at) = &self.failed_at { format!("{:?}", failed_at) } else { String::new() }, if let Some(failed_reason) = &self.failed_reason { format!("{:?}", failed_reason) } else { String::new() }, format!("{:?}", self.inviter), format!("{:?}", self.team_count), self.node_id.clone(), self.invitation_teams_url.clone(), ] } fn headers() -> Vec { vec![ "id".to_string(), "login".to_string(), "email".to_string(), "role".to_string(), "created_at".to_string(), "failed_at".to_string(), "failed_reason".to_string(), "inviter".to_string(), "team_count".to_string(), "node_id".to_string(), "invitation_teams_url".to_string(), ] } } #[doc = "Org Hook"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrgHook { pub id: i64, pub url: url::Url, pub ping_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub deliveries_url: Option, pub name: String, pub events: Vec, pub active: bool, pub config: Config, pub updated_at: chrono::DateTime, pub created_at: chrono::DateTime, #[serde(rename = "type")] pub type_: String, } impl std::fmt::Display for OrgHook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrgHook { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.url), format!("{:?}", self.ping_url), if let Some(deliveries_url) = &self.deliveries_url { format!("{:?}", deliveries_url) } else { String::new() }, self.name.clone(), format!("{:?}", self.events), format!("{:?}", self.active), format!("{:?}", self.config), format!("{:?}", self.updated_at), format!("{:?}", self.created_at), self.type_.clone(), ] } fn headers() -> Vec { vec![ "id".to_string(), "url".to_string(), "ping_url".to_string(), "deliveries_url".to_string(), "name".to_string(), "events".to_string(), "active".to_string(), "config".to_string(), "updated_at".to_string(), "created_at".to_string(), "type_".to_string(), ] } } #[doc = "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum InteractionGroup { #[serde(rename = "existing_users")] #[display("existing_users")] ExistingUsers, #[serde(rename = "contributors_only")] #[display("contributors_only")] ContributorsOnly, #[serde(rename = "collaborators_only")] #[display("collaborators_only")] CollaboratorsOnly, } #[doc = "Interaction limit settings."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct InteractionLimitResponse { #[doc = "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect."] pub limit: InteractionGroup, pub origin: String, pub expires_at: chrono::DateTime, } impl std::fmt::Display for InteractionLimitResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for InteractionLimitResponse { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.limit), self.origin.clone(), format!("{:?}", self.expires_at), ] } fn headers() -> Vec { vec![ "limit".to_string(), "origin".to_string(), "expires_at".to_string(), ] } } #[doc = "The duration of the interaction restriction. Default: `one_day`."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum InteractionExpiry { #[serde(rename = "one_day")] #[display("one_day")] OneDay, #[serde(rename = "three_days")] #[display("three_days")] ThreeDays, #[serde(rename = "one_week")] #[display("one_week")] OneWeek, #[serde(rename = "one_month")] #[display("one_month")] OneMonth, #[serde(rename = "six_months")] #[display("six_months")] SixMonths, } #[doc = "Limit interactions to a specific type of user for a specified duration"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct InteractionLimit { #[doc = "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect."] pub limit: InteractionGroup, #[doc = "The duration of the interaction restriction. Default: `one_day`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub expiry: Option, } impl std::fmt::Display for InteractionLimit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for InteractionLimit { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.limit), if let Some(expiry) = &self.expiry { format!("{:?}", expiry) } else { String::new() }, ] } fn headers() -> Vec { vec!["limit".to_string(), "expiry".to_string()] } } #[doc = "Groups of organization members that gives permissions on specified repositories."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableTeamSimple { #[doc = "Unique identifier of the team"] pub id: i64, pub node_id: String, #[doc = "URL for the team"] pub url: url::Url, pub members_url: String, #[doc = "Name of the team"] pub name: String, #[doc = "Description of the team"] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Permission that the team will have for its repositories"] pub permission: String, #[doc = "The level of privacy this team should have"] #[serde(default, skip_serializing_if = "Option::is_none")] pub privacy: Option, pub html_url: url::Url, pub repositories_url: url::Url, pub slug: String, #[doc = "Distinguished Name (DN) that team maps to within LDAP environment"] #[serde(default, skip_serializing_if = "Option::is_none")] pub ldap_dn: Option, } impl std::fmt::Display for NullableTeamSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableTeamSimple { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), self.members_url.clone(), self.name.clone(), format!("{:?}", self.description), self.permission.clone(), if let Some(privacy) = &self.privacy { format!("{:?}", privacy) } else { String::new() }, format!("{:?}", self.html_url), format!("{:?}", self.repositories_url), self.slug.clone(), if let Some(ldap_dn) = &self.ldap_dn { format!("{:?}", ldap_dn) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "members_url".to_string(), "name".to_string(), "description".to_string(), "permission".to_string(), "privacy".to_string(), "html_url".to_string(), "repositories_url".to_string(), "slug".to_string(), "ldap_dn".to_string(), ] } } #[doc = "Groups of organization members that gives permissions on specified repositories."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Team { pub id: i64, pub node_id: String, pub name: String, pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub privacy: Option, pub permission: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, pub url: url::Url, pub html_url: url::Url, pub members_url: String, pub repositories_url: url::Url, #[doc = "Groups of organization members that gives permissions on specified repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, } impl std::fmt::Display for Team { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Team { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.slug.clone(), format!("{:?}", self.description), if let Some(privacy) = &self.privacy { format!("{:?}", privacy) } else { String::new() }, self.permission.clone(), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, format!("{:?}", self.url), format!("{:?}", self.html_url), self.members_url.clone(), format!("{:?}", self.repositories_url), format!("{:?}", self.parent), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "slug".to_string(), "description".to_string(), "privacy".to_string(), "permission".to_string(), "permissions".to_string(), "url".to_string(), "html_url".to_string(), "members_url".to_string(), "repositories_url".to_string(), "parent".to_string(), ] } } #[doc = "An export of a codespace. Also, latest export details for a codespace can be fetched with id = latest"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodespaceExportDetails { #[doc = "State of the latest export"] #[serde(default, skip_serializing_if = "Option::is_none")] pub state: Option, #[doc = "Completion time of the last export operation"] #[serde(default, skip_serializing_if = "Option::is_none")] pub completed_at: Option>, #[doc = "Name of the exported branch"] #[serde(default, skip_serializing_if = "Option::is_none")] pub branch: Option, #[doc = "Git commit SHA of the exported branch"] #[serde(default, skip_serializing_if = "Option::is_none")] pub sha: Option, #[doc = "Id for the export details"] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "Url for fetching export details"] #[serde(default, skip_serializing_if = "Option::is_none")] pub export_url: Option, #[doc = "Web url for the exported branch"] #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for CodespaceExportDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodespaceExportDetails { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ if let Some(state) = &self.state { format!("{:?}", state) } else { String::new() }, if let Some(completed_at) = &self.completed_at { format!("{:?}", completed_at) } else { String::new() }, if let Some(branch) = &self.branch { format!("{:?}", branch) } else { String::new() }, if let Some(sha) = &self.sha { format!("{:?}", sha) } else { String::new() }, if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(export_url) = &self.export_url { format!("{:?}", export_url) } else { String::new() }, if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "state".to_string(), "completed_at".to_string(), "branch".to_string(), "sha".to_string(), "id".to_string(), "export_url".to_string(), "html_url".to_string(), ] } } #[doc = "Org Membership"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OrgMembership { pub url: url::Url, #[doc = "The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation."] pub state: State, #[doc = "The user's membership type in the organization."] pub role: Role, pub organization_url: url::Url, #[doc = "Organization Simple"] pub organization: OrganizationSimple, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, } impl std::fmt::Display for OrgMembership { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OrgMembership { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.state), format!("{:?}", self.role), format!("{:?}", self.organization_url), format!("{:?}", self.organization), format!("{:?}", self.user), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "state".to_string(), "role".to_string(), "organization_url".to_string(), "organization".to_string(), "user".to_string(), "permissions".to_string(), ] } } #[doc = "A migration."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Migration { pub id: i64, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, pub guid: String, pub state: String, pub lock_repositories: bool, pub exclude_metadata: bool, pub exclude_git_data: bool, pub exclude_attachments: bool, pub exclude_releases: bool, pub exclude_owner_projects: bool, pub org_metadata_only: bool, pub repositories: Vec, pub url: url::Url, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub archive_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub exclude: Option>, } impl std::fmt::Display for Migration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Migration { const LENGTH: usize = 18; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.owner), self.guid.clone(), self.state.clone(), format!("{:?}", self.lock_repositories), format!("{:?}", self.exclude_metadata), format!("{:?}", self.exclude_git_data), format!("{:?}", self.exclude_attachments), format!("{:?}", self.exclude_releases), format!("{:?}", self.exclude_owner_projects), format!("{:?}", self.org_metadata_only), format!("{:?}", self.repositories), format!("{:?}", self.url), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), self.node_id.clone(), if let Some(archive_url) = &self.archive_url { format!("{:?}", archive_url) } else { String::new() }, if let Some(exclude) = &self.exclude { format!("{:?}", exclude) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "owner".to_string(), "guid".to_string(), "state".to_string(), "lock_repositories".to_string(), "exclude_metadata".to_string(), "exclude_git_data".to_string(), "exclude_attachments".to_string(), "exclude_releases".to_string(), "exclude_owner_projects".to_string(), "org_metadata_only".to_string(), "repositories".to_string(), "url".to_string(), "created_at".to_string(), "updated_at".to_string(), "node_id".to_string(), "archive_url".to_string(), "exclude".to_string(), ] } } #[doc = "Minimal Repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableMinimalRepository { pub id: i64, pub node_id: String, pub name: String, pub full_name: String, #[doc = "Simple User"] pub owner: SimpleUser, pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub ssh_url: Option, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub clone_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub svn_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub stargazers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub watchers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub size: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub default_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub open_issues_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_issues: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_projects: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_wiki: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_pages: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_downloads: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub archived: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub disabled: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub role_name: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscribers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub network_count: Option, #[doc = "Code Of Conduct"] #[serde(default, skip_serializing_if = "Option::is_none")] pub code_of_conduct: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub forks: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub open_issues: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub watchers: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, } impl std::fmt::Display for NullableMinimalRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableMinimalRepository { const LENGTH: usize = 85; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), if let Some(git_url) = &self.git_url { format!("{:?}", git_url) } else { String::new() }, self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), if let Some(ssh_url) = &self.ssh_url { format!("{:?}", ssh_url) } else { String::new() }, format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), if let Some(clone_url) = &self.clone_url { format!("{:?}", clone_url) } else { String::new() }, if let Some(mirror_url) = &self.mirror_url { format!("{:?}", mirror_url) } else { String::new() }, format!("{:?}", self.hooks_url), if let Some(svn_url) = &self.svn_url { format!("{:?}", svn_url) } else { String::new() }, if let Some(homepage) = &self.homepage { format!("{:?}", homepage) } else { String::new() }, if let Some(language) = &self.language { format!("{:?}", language) } else { String::new() }, if let Some(forks_count) = &self.forks_count { format!("{:?}", forks_count) } else { String::new() }, if let Some(stargazers_count) = &self.stargazers_count { format!("{:?}", stargazers_count) } else { String::new() }, if let Some(watchers_count) = &self.watchers_count { format!("{:?}", watchers_count) } else { String::new() }, if let Some(size) = &self.size { format!("{:?}", size) } else { String::new() }, if let Some(default_branch) = &self.default_branch { format!("{:?}", default_branch) } else { String::new() }, if let Some(open_issues_count) = &self.open_issues_count { format!("{:?}", open_issues_count) } else { String::new() }, if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, if let Some(has_issues) = &self.has_issues { format!("{:?}", has_issues) } else { String::new() }, if let Some(has_projects) = &self.has_projects { format!("{:?}", has_projects) } else { String::new() }, if let Some(has_wiki) = &self.has_wiki { format!("{:?}", has_wiki) } else { String::new() }, if let Some(has_pages) = &self.has_pages { format!("{:?}", has_pages) } else { String::new() }, if let Some(has_downloads) = &self.has_downloads { format!("{:?}", has_downloads) } else { String::new() }, if let Some(archived) = &self.archived { format!("{:?}", archived) } else { String::new() }, if let Some(disabled) = &self.disabled { format!("{:?}", disabled) } else { String::new() }, if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, if let Some(pushed_at) = &self.pushed_at { format!("{:?}", pushed_at) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(role_name) = &self.role_name { format!("{:?}", role_name) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(subscribers_count) = &self.subscribers_count { format!("{:?}", subscribers_count) } else { String::new() }, if let Some(network_count) = &self.network_count { format!("{:?}", network_count) } else { String::new() }, if let Some(code_of_conduct) = &self.code_of_conduct { format!("{:?}", code_of_conduct) } else { String::new() }, if let Some(license) = &self.license { format!("{:?}", license) } else { String::new() }, if let Some(forks) = &self.forks { format!("{:?}", forks) } else { String::new() }, if let Some(open_issues) = &self.open_issues { format!("{:?}", open_issues) } else { String::new() }, if let Some(watchers) = &self.watchers { format!("{:?}", watchers) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "permissions".to_string(), "role_name".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "delete_branch_on_merge".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "code_of_conduct".to_string(), "license".to_string(), "forks".to_string(), "open_issues".to_string(), "watchers".to_string(), "allow_forking".to_string(), ] } } #[doc = "A software package"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Package { #[doc = "Unique identifier of the package."] pub id: i64, #[doc = "The name of the package."] pub name: String, pub package_type: PackageType, pub url: String, pub html_url: String, #[doc = "The number of versions of the package."] pub version_count: i64, pub visibility: Visibility, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[doc = "Minimal Repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for Package { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Package { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), format!("{:?}", self.package_type), self.url.clone(), self.html_url.clone(), format!("{:?}", self.version_count), format!("{:?}", self.visibility), if let Some(owner) = &self.owner { format!("{:?}", owner) } else { String::new() }, if let Some(repository) = &self.repository { format!("{:?}", repository) } else { String::new() }, format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "package_type".to_string(), "url".to_string(), "html_url".to_string(), "version_count".to_string(), "visibility".to_string(), "owner".to_string(), "repository".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[doc = "A version of a software package"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PackageVersion { #[doc = "Unique identifier of the package version."] pub id: i64, #[doc = "The name of the package version."] pub name: String, pub url: String, pub package_html_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub deleted_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option, } impl std::fmt::Display for PackageVersion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PackageVersion { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.name.clone(), self.url.clone(), self.package_html_url.clone(), if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, if let Some(license) = &self.license { format!("{:?}", license) } else { String::new() }, if let Some(description) = &self.description { format!("{:?}", description) } else { String::new() }, format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(deleted_at) = &self.deleted_at { format!("{:?}", deleted_at) } else { String::new() }, if let Some(metadata) = &self.metadata { format!("{:?}", metadata) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "url".to_string(), "package_html_url".to_string(), "html_url".to_string(), "license".to_string(), "description".to_string(), "created_at".to_string(), "updated_at".to_string(), "deleted_at".to_string(), "metadata".to_string(), ] } } #[doc = "Projects are a way to organize columns and cards of work."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Project { pub owner_url: url::Url, pub url: url::Url, pub html_url: url::Url, pub columns_url: url::Url, pub id: i64, pub node_id: String, #[doc = "Name of the project"] pub name: String, #[doc = "Body of the project"] #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, pub number: i64, #[doc = "State of the project; either 'open' or 'closed'"] pub state: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "The baseline permission that all organization members have on this project. Only present if owner is an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_permission: Option, #[doc = "Whether or not this project can be seen by everyone. Only present if owner is an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub private: Option, } impl std::fmt::Display for Project { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Project { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ format!("{:?}", self.owner_url), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.columns_url), format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), format!("{:?}", self.body), format!("{:?}", self.number), self.state.clone(), format!("{:?}", self.creator), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(organization_permission) = &self.organization_permission { format!("{:?}", organization_permission) } else { String::new() }, if let Some(private) = &self.private { format!("{:?}", private) } else { String::new() }, ] } fn headers() -> Vec { vec![ "owner_url".to_string(), "url".to_string(), "html_url".to_string(), "columns_url".to_string(), "id".to_string(), "node_id".to_string(), "name".to_string(), "body".to_string(), "number".to_string(), "state".to_string(), "creator".to_string(), "created_at".to_string(), "updated_at".to_string(), "organization_permission".to_string(), "private".to_string(), ] } } #[doc = "External Groups to be mapped to a team for membership"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GroupMapping { #[doc = "Array of groups to be mapped to this team"] #[serde(default, skip_serializing_if = "Option::is_none")] pub groups: Option>, } impl std::fmt::Display for GroupMapping { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GroupMapping { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![if let Some(groups) = &self.groups { format!("{:?}", groups) } else { String::new() }] } fn headers() -> Vec { vec!["groups".to_string()] } } #[doc = "Groups of organization members that gives permissions on specified repositories."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamFull { #[doc = "Unique identifier of the team"] pub id: i64, pub node_id: String, #[doc = "URL for the team"] pub url: url::Url, pub html_url: url::Url, #[doc = "Name of the team"] pub name: String, pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "The level of privacy this team should have"] #[serde(default, skip_serializing_if = "Option::is_none")] pub privacy: Option, #[doc = "Permission that the team will have for its repositories"] pub permission: String, pub members_url: String, pub repositories_url: url::Url, #[doc = "Groups of organization members that gives permissions on specified repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, pub members_count: i64, pub repos_count: i64, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Organization Full"] pub organization: OrganizationFull, #[doc = "Distinguished Name (DN) that team maps to within LDAP environment"] #[serde(default, skip_serializing_if = "Option::is_none")] pub ldap_dn: Option, } impl std::fmt::Display for TeamFull { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamFull { const LENGTH: usize = 18; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.html_url), self.name.clone(), self.slug.clone(), format!("{:?}", self.description), if let Some(privacy) = &self.privacy { format!("{:?}", privacy) } else { String::new() }, self.permission.clone(), self.members_url.clone(), format!("{:?}", self.repositories_url), if let Some(parent) = &self.parent { format!("{:?}", parent) } else { String::new() }, format!("{:?}", self.members_count), format!("{:?}", self.repos_count), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.organization), if let Some(ldap_dn) = &self.ldap_dn { format!("{:?}", ldap_dn) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "html_url".to_string(), "name".to_string(), "slug".to_string(), "description".to_string(), "privacy".to_string(), "permission".to_string(), "members_url".to_string(), "repositories_url".to_string(), "parent".to_string(), "members_count".to_string(), "repos_count".to_string(), "created_at".to_string(), "updated_at".to_string(), "organization".to_string(), "ldap_dn".to_string(), ] } } #[doc = "A team discussion is a persistent record of a free-form conversation within a team."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamDiscussion { #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub author: Option, #[doc = "The main text of the discussion."] pub body: String, pub body_html: String, #[doc = "The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server."] pub body_version: String, pub comments_count: i64, pub comments_url: url::Url, pub created_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub last_edited_at: Option>, pub html_url: url::Url, pub node_id: String, #[doc = "The unique sequence number of a team discussion."] pub number: i64, #[doc = "Whether or not this discussion should be pinned for easy retrieval."] pub pinned: bool, #[doc = "Whether or not this discussion should be restricted to team members and organization administrators."] pub private: bool, pub team_url: url::Url, #[doc = "The title of the discussion."] pub title: String, pub updated_at: chrono::DateTime, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for TeamDiscussion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamDiscussion { const LENGTH: usize = 18; fn fields(&self) -> Vec { vec![ format!("{:?}", self.author), self.body.clone(), self.body_html.clone(), self.body_version.clone(), format!("{:?}", self.comments_count), format!("{:?}", self.comments_url), format!("{:?}", self.created_at), format!("{:?}", self.last_edited_at), format!("{:?}", self.html_url), self.node_id.clone(), format!("{:?}", self.number), format!("{:?}", self.pinned), format!("{:?}", self.private), format!("{:?}", self.team_url), self.title.clone(), format!("{:?}", self.updated_at), format!("{:?}", self.url), if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "author".to_string(), "body".to_string(), "body_html".to_string(), "body_version".to_string(), "comments_count".to_string(), "comments_url".to_string(), "created_at".to_string(), "last_edited_at".to_string(), "html_url".to_string(), "node_id".to_string(), "number".to_string(), "pinned".to_string(), "private".to_string(), "team_url".to_string(), "title".to_string(), "updated_at".to_string(), "url".to_string(), "reactions".to_string(), ] } } #[doc = "A reply to a discussion within a team."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamDiscussionComment { #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub author: Option, #[doc = "The main text of the comment."] pub body: String, pub body_html: String, #[doc = "The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server."] pub body_version: String, pub created_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub last_edited_at: Option>, pub discussion_url: url::Url, pub html_url: url::Url, pub node_id: String, #[doc = "The unique sequence number of a team discussion comment."] pub number: i64, pub updated_at: chrono::DateTime, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for TeamDiscussionComment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamDiscussionComment { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ format!("{:?}", self.author), self.body.clone(), self.body_html.clone(), self.body_version.clone(), format!("{:?}", self.created_at), format!("{:?}", self.last_edited_at), format!("{:?}", self.discussion_url), format!("{:?}", self.html_url), self.node_id.clone(), format!("{:?}", self.number), format!("{:?}", self.updated_at), format!("{:?}", self.url), if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "author".to_string(), "body".to_string(), "body_html".to_string(), "body_version".to_string(), "created_at".to_string(), "last_edited_at".to_string(), "discussion_url".to_string(), "html_url".to_string(), "node_id".to_string(), "number".to_string(), "updated_at".to_string(), "url".to_string(), "reactions".to_string(), ] } } #[doc = "Reactions to conversations provide a way to help people express their feelings more simply and effectively."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Reaction { pub id: i64, pub node_id: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[doc = "The reaction to use"] pub content: Content, pub created_at: chrono::DateTime, } impl std::fmt::Display for Reaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Reaction { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.user), format!("{:?}", self.content), format!("{:?}", self.created_at), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "user".to_string(), "content".to_string(), "created_at".to_string(), ] } } #[doc = "Team Membership"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamMembership { pub url: url::Url, #[doc = "The role of the user in the team."] pub role: Role, #[doc = "The state of the user's membership in the team."] pub state: State, } impl std::fmt::Display for TeamMembership { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamMembership { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.role), format!("{:?}", self.state), ] } fn headers() -> Vec { vec!["url".to_string(), "role".to_string(), "state".to_string()] } } #[doc = "A team's access to a project."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamProject { pub owner_url: String, pub url: String, pub html_url: String, pub columns_url: String, pub id: i64, pub node_id: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, pub number: i64, pub state: String, #[doc = "Simple User"] pub creator: SimpleUser, pub created_at: String, pub updated_at: String, #[doc = "The organization permission for this project. Only present when owner is an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization_permission: Option, #[doc = "Whether the project is private or not. Only present when owner is an organization."] #[serde(default, skip_serializing_if = "Option::is_none")] pub private: Option, pub permissions: Permissions, } impl std::fmt::Display for TeamProject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamProject { const LENGTH: usize = 16; fn fields(&self) -> Vec { vec![ self.owner_url.clone(), self.url.clone(), self.html_url.clone(), self.columns_url.clone(), format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), format!("{:?}", self.body), format!("{:?}", self.number), self.state.clone(), format!("{:?}", self.creator), self.created_at.clone(), self.updated_at.clone(), if let Some(organization_permission) = &self.organization_permission { format!("{:?}", organization_permission) } else { String::new() }, if let Some(private) = &self.private { format!("{:?}", private) } else { String::new() }, format!("{:?}", self.permissions), ] } fn headers() -> Vec { vec![ "owner_url".to_string(), "url".to_string(), "html_url".to_string(), "columns_url".to_string(), "id".to_string(), "node_id".to_string(), "name".to_string(), "body".to_string(), "number".to_string(), "state".to_string(), "creator".to_string(), "created_at".to_string(), "updated_at".to_string(), "organization_permission".to_string(), "private".to_string(), "permissions".to_string(), ] } } #[doc = "A team's access to a repository."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct TeamRepository { #[doc = "Unique identifier of the repository"] pub id: i64, pub node_id: String, #[doc = "The name of the repository."] pub name: String, pub full_name: String, #[doc = "License Simple"] #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, pub forks: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub role_name: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub owner: Option, #[doc = "Whether the repository is private or public."] pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, pub git_url: String, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, pub ssh_url: String, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, pub clone_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, pub svn_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, pub forks_count: i64, pub stargazers_count: i64, pub watchers_count: i64, pub size: i64, #[doc = "The default branch of the repository."] pub default_branch: String, pub open_issues_count: i64, #[doc = "Whether this repository acts as a template that can be used to generate new repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, #[doc = "Whether issues are enabled."] pub has_issues: bool, #[doc = "Whether projects are enabled."] pub has_projects: bool, #[doc = "Whether the wiki is enabled."] pub has_wiki: bool, pub has_pages: bool, #[doc = "Whether downloads are enabled."] pub has_downloads: bool, #[doc = "Whether the repository is archived."] pub archived: bool, #[doc = "Returns whether or not this repository disabled."] pub disabled: bool, #[doc = "The repository visibility: public, private, or internal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pushed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "Whether to allow rebase merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_rebase_merge: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[doc = "Whether to allow squash merges for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_squash_merge: Option, #[doc = "Whether to allow Auto-merge to be used on pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_auto_merge: Option, #[doc = "Whether to delete head branches when pull requests are merged"] #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[doc = "Whether to allow merge commits for pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_merge_commit: Option, #[doc = "Whether to allow forking this repo"] #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscribers_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub network_count: Option, pub open_issues: i64, pub watchers: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub master_branch: Option, } impl std::fmt::Display for TeamRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for TeamRepository { const LENGTH: usize = 89; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.license), format!("{:?}", self.forks), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(role_name) = &self.role_name { format!("{:?}", role_name) } else { String::new() }, format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), self.git_url.clone(), self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), self.ssh_url.clone(), format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), self.clone_url.clone(), format!("{:?}", self.mirror_url), format!("{:?}", self.hooks_url), format!("{:?}", self.svn_url), format!("{:?}", self.homepage), format!("{:?}", self.language), format!("{:?}", self.forks_count), format!("{:?}", self.stargazers_count), format!("{:?}", self.watchers_count), format!("{:?}", self.size), self.default_branch.clone(), format!("{:?}", self.open_issues_count), if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, format!("{:?}", self.has_issues), format!("{:?}", self.has_projects), format!("{:?}", self.has_wiki), format!("{:?}", self.has_pages), format!("{:?}", self.has_downloads), format!("{:?}", self.archived), format!("{:?}", self.disabled), if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, format!("{:?}", self.pushed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(allow_rebase_merge) = &self.allow_rebase_merge { format!("{:?}", allow_rebase_merge) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(allow_squash_merge) = &self.allow_squash_merge { format!("{:?}", allow_squash_merge) } else { String::new() }, if let Some(allow_auto_merge) = &self.allow_auto_merge { format!("{:?}", allow_auto_merge) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(allow_merge_commit) = &self.allow_merge_commit { format!("{:?}", allow_merge_commit) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, if let Some(subscribers_count) = &self.subscribers_count { format!("{:?}", subscribers_count) } else { String::new() }, if let Some(network_count) = &self.network_count { format!("{:?}", network_count) } else { String::new() }, format!("{:?}", self.open_issues), format!("{:?}", self.watchers), if let Some(master_branch) = &self.master_branch { format!("{:?}", master_branch) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "license".to_string(), "forks".to_string(), "permissions".to_string(), "role_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "allow_rebase_merge".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "allow_squash_merge".to_string(), "allow_auto_merge".to_string(), "delete_branch_on_merge".to_string(), "allow_merge_commit".to_string(), "allow_forking".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "open_issues".to_string(), "watchers".to_string(), "master_branch".to_string(), ] } } #[doc = "Project cards represent a scope of work."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProjectCard { pub url: url::Url, #[doc = "The project card's ID"] pub id: i64, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub note: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Whether or not the card is archived"] #[serde(default, skip_serializing_if = "Option::is_none")] pub archived: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub column_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_id: Option, pub column_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub content_url: Option, pub project_url: url::Url, } impl std::fmt::Display for ProjectCard { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProjectCard { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.note), format!("{:?}", self.creator), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(archived) = &self.archived { format!("{:?}", archived) } else { String::new() }, if let Some(column_name) = &self.column_name { format!("{:?}", column_name) } else { String::new() }, if let Some(project_id) = &self.project_id { format!("{:?}", project_id) } else { String::new() }, format!("{:?}", self.column_url), if let Some(content_url) = &self.content_url { format!("{:?}", content_url) } else { String::new() }, format!("{:?}", self.project_url), ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "node_id".to_string(), "note".to_string(), "creator".to_string(), "created_at".to_string(), "updated_at".to_string(), "archived".to_string(), "column_name".to_string(), "project_id".to_string(), "column_url".to_string(), "content_url".to_string(), "project_url".to_string(), ] } } #[doc = "Project columns contain cards of work."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProjectColumn { pub url: url::Url, pub project_url: url::Url, pub cards_url: url::Url, #[doc = "The unique identifier of the project column"] pub id: i64, pub node_id: String, #[doc = "Name of the project column"] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for ProjectColumn { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProjectColumn { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.project_url), format!("{:?}", self.cards_url), format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "url".to_string(), "project_url".to_string(), "cards_url".to_string(), "id".to_string(), "node_id".to_string(), "name".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[doc = "Project Collaborator Permission"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProjectCollaboratorPermission { pub permission: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, } impl std::fmt::Display for ProjectCollaboratorPermission { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProjectCollaboratorPermission { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.permission.clone(), format!("{:?}", self.user)] } fn headers() -> Vec { vec!["permission".to_string(), "user".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RateLimit { pub limit: i64, pub remaining: i64, pub reset: i64, pub used: i64, } impl std::fmt::Display for RateLimit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RateLimit { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.limit), format!("{:?}", self.remaining), format!("{:?}", self.reset), format!("{:?}", self.used), ] } fn headers() -> Vec { vec![ "limit".to_string(), "remaining".to_string(), "reset".to_string(), "used".to_string(), ] } } #[doc = "Rate Limit Overview"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RateLimitOverview { pub resources: Resources, pub rate: RateLimit, } impl std::fmt::Display for RateLimitOverview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RateLimitOverview { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.resources), format!("{:?}", self.rate)] } fn headers() -> Vec { vec!["resources".to_string(), "rate".to_string()] } } #[doc = "Code of Conduct Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeOfConductSimple { pub url: url::Url, pub key: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for CodeOfConductSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeOfConductSimple { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), self.key.clone(), self.name.clone(), format!("{:?}", self.html_url), ] } fn headers() -> Vec { vec![ "url".to_string(), "key".to_string(), "name".to_string(), "html_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SecurityAndAnalysis { #[serde(default, skip_serializing_if = "Option::is_none")] pub advanced_security: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub secret_scanning: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub secret_scanning_push_protection: Option, } impl std::fmt::Display for SecurityAndAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SecurityAndAnalysis { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(advanced_security) = &self.advanced_security { format!("{:?}", advanced_security) } else { String::new() }, if let Some(secret_scanning) = &self.secret_scanning { format!("{:?}", secret_scanning) } else { String::new() }, if let Some(secret_scanning_push_protection) = &self.secret_scanning_push_protection { format!("{:?}", secret_scanning_push_protection) } else { String::new() }, ] } fn headers() -> Vec { vec![ "advanced_security".to_string(), "secret_scanning".to_string(), "secret_scanning_push_protection".to_string(), ] } } #[doc = "Full Repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct FullRepository { pub id: i64, pub node_id: String, pub name: String, pub full_name: String, #[doc = "Simple User"] pub owner: SimpleUser, pub private: bool, pub html_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub fork: bool, pub url: url::Url, pub archive_url: String, pub assignees_url: String, pub blobs_url: String, pub branches_url: String, pub collaborators_url: String, pub comments_url: String, pub commits_url: String, pub compare_url: String, pub contents_url: String, pub contributors_url: url::Url, pub deployments_url: url::Url, pub downloads_url: url::Url, pub events_url: url::Url, pub forks_url: url::Url, pub git_commits_url: String, pub git_refs_url: String, pub git_tags_url: String, pub git_url: String, pub issue_comment_url: String, pub issue_events_url: String, pub issues_url: String, pub keys_url: String, pub labels_url: String, pub languages_url: url::Url, pub merges_url: url::Url, pub milestones_url: String, pub notifications_url: String, pub pulls_url: String, pub releases_url: String, pub ssh_url: String, pub stargazers_url: url::Url, pub statuses_url: String, pub subscribers_url: url::Url, pub subscription_url: url::Url, pub tags_url: url::Url, pub teams_url: url::Url, pub trees_url: String, pub clone_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub mirror_url: Option, pub hooks_url: url::Url, pub svn_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub homepage: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub language: Option, pub forks_count: i64, pub stargazers_count: i64, pub watchers_count: i64, pub size: i64, pub default_branch: String, pub open_issues_count: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub is_template: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub topics: Option>, pub has_issues: bool, pub has_projects: bool, pub has_wiki: bool, pub has_pages: bool, pub has_downloads: bool, pub archived: bool, #[doc = "Returns whether or not this repository disabled."] pub disabled: bool, #[doc = "The repository visibility: public, private, or internal."] #[serde(default, skip_serializing_if = "Option::is_none")] pub visibility: Option, pub pushed_at: chrono::DateTime, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_rebase_merge: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub template_repository: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub temp_clone_token: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_squash_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_auto_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub delete_branch_on_merge: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_merge_commit: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_update_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_forking: Option, pub subscribers_count: i64, pub network_count: i64, #[doc = "License Simple"] #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub organization: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub source: Option, pub forks: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub master_branch: Option, pub open_issues: i64, pub watchers: i64, #[doc = "Whether anonymous git access is allowed."] #[serde(default, skip_serializing_if = "Option::is_none")] pub anonymous_access_enabled: Option, #[doc = "Code of Conduct Simple"] #[serde(default, skip_serializing_if = "Option::is_none")] pub code_of_conduct: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub security_and_analysis: Option, } impl std::fmt::Display for FullRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for FullRepository { const LENGTH: usize = 96; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.full_name.clone(), format!("{:?}", self.owner), format!("{:?}", self.private), format!("{:?}", self.html_url), format!("{:?}", self.description), format!("{:?}", self.fork), format!("{:?}", self.url), self.archive_url.clone(), self.assignees_url.clone(), self.blobs_url.clone(), self.branches_url.clone(), self.collaborators_url.clone(), self.comments_url.clone(), self.commits_url.clone(), self.compare_url.clone(), self.contents_url.clone(), format!("{:?}", self.contributors_url), format!("{:?}", self.deployments_url), format!("{:?}", self.downloads_url), format!("{:?}", self.events_url), format!("{:?}", self.forks_url), self.git_commits_url.clone(), self.git_refs_url.clone(), self.git_tags_url.clone(), self.git_url.clone(), self.issue_comment_url.clone(), self.issue_events_url.clone(), self.issues_url.clone(), self.keys_url.clone(), self.labels_url.clone(), format!("{:?}", self.languages_url), format!("{:?}", self.merges_url), self.milestones_url.clone(), self.notifications_url.clone(), self.pulls_url.clone(), self.releases_url.clone(), self.ssh_url.clone(), format!("{:?}", self.stargazers_url), self.statuses_url.clone(), format!("{:?}", self.subscribers_url), format!("{:?}", self.subscription_url), format!("{:?}", self.tags_url), format!("{:?}", self.teams_url), self.trees_url.clone(), self.clone_url.clone(), format!("{:?}", self.mirror_url), format!("{:?}", self.hooks_url), format!("{:?}", self.svn_url), format!("{:?}", self.homepage), format!("{:?}", self.language), format!("{:?}", self.forks_count), format!("{:?}", self.stargazers_count), format!("{:?}", self.watchers_count), format!("{:?}", self.size), self.default_branch.clone(), format!("{:?}", self.open_issues_count), if let Some(is_template) = &self.is_template { format!("{:?}", is_template) } else { String::new() }, if let Some(topics) = &self.topics { format!("{:?}", topics) } else { String::new() }, format!("{:?}", self.has_issues), format!("{:?}", self.has_projects), format!("{:?}", self.has_wiki), format!("{:?}", self.has_pages), format!("{:?}", self.has_downloads), format!("{:?}", self.archived), format!("{:?}", self.disabled), if let Some(visibility) = &self.visibility { format!("{:?}", visibility) } else { String::new() }, format!("{:?}", self.pushed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, if let Some(allow_rebase_merge) = &self.allow_rebase_merge { format!("{:?}", allow_rebase_merge) } else { String::new() }, if let Some(template_repository) = &self.template_repository { format!("{:?}", template_repository) } else { String::new() }, if let Some(temp_clone_token) = &self.temp_clone_token { format!("{:?}", temp_clone_token) } else { String::new() }, if let Some(allow_squash_merge) = &self.allow_squash_merge { format!("{:?}", allow_squash_merge) } else { String::new() }, if let Some(allow_auto_merge) = &self.allow_auto_merge { format!("{:?}", allow_auto_merge) } else { String::new() }, if let Some(delete_branch_on_merge) = &self.delete_branch_on_merge { format!("{:?}", delete_branch_on_merge) } else { String::new() }, if let Some(allow_merge_commit) = &self.allow_merge_commit { format!("{:?}", allow_merge_commit) } else { String::new() }, if let Some(allow_update_branch) = &self.allow_update_branch { format!("{:?}", allow_update_branch) } else { String::new() }, if let Some(use_squash_pr_title_as_default) = &self.use_squash_pr_title_as_default { format!("{:?}", use_squash_pr_title_as_default) } else { String::new() }, if let Some(allow_forking) = &self.allow_forking { format!("{:?}", allow_forking) } else { String::new() }, format!("{:?}", self.subscribers_count), format!("{:?}", self.network_count), format!("{:?}", self.license), if let Some(organization) = &self.organization { format!("{:?}", organization) } else { String::new() }, if let Some(parent) = &self.parent { format!("{:?}", parent) } else { String::new() }, if let Some(source) = &self.source { format!("{:?}", source) } else { String::new() }, format!("{:?}", self.forks), if let Some(master_branch) = &self.master_branch { format!("{:?}", master_branch) } else { String::new() }, format!("{:?}", self.open_issues), format!("{:?}", self.watchers), if let Some(anonymous_access_enabled) = &self.anonymous_access_enabled { format!("{:?}", anonymous_access_enabled) } else { String::new() }, if let Some(code_of_conduct) = &self.code_of_conduct { format!("{:?}", code_of_conduct) } else { String::new() }, if let Some(security_and_analysis) = &self.security_and_analysis { format!("{:?}", security_and_analysis) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "full_name".to_string(), "owner".to_string(), "private".to_string(), "html_url".to_string(), "description".to_string(), "fork".to_string(), "url".to_string(), "archive_url".to_string(), "assignees_url".to_string(), "blobs_url".to_string(), "branches_url".to_string(), "collaborators_url".to_string(), "comments_url".to_string(), "commits_url".to_string(), "compare_url".to_string(), "contents_url".to_string(), "contributors_url".to_string(), "deployments_url".to_string(), "downloads_url".to_string(), "events_url".to_string(), "forks_url".to_string(), "git_commits_url".to_string(), "git_refs_url".to_string(), "git_tags_url".to_string(), "git_url".to_string(), "issue_comment_url".to_string(), "issue_events_url".to_string(), "issues_url".to_string(), "keys_url".to_string(), "labels_url".to_string(), "languages_url".to_string(), "merges_url".to_string(), "milestones_url".to_string(), "notifications_url".to_string(), "pulls_url".to_string(), "releases_url".to_string(), "ssh_url".to_string(), "stargazers_url".to_string(), "statuses_url".to_string(), "subscribers_url".to_string(), "subscription_url".to_string(), "tags_url".to_string(), "teams_url".to_string(), "trees_url".to_string(), "clone_url".to_string(), "mirror_url".to_string(), "hooks_url".to_string(), "svn_url".to_string(), "homepage".to_string(), "language".to_string(), "forks_count".to_string(), "stargazers_count".to_string(), "watchers_count".to_string(), "size".to_string(), "default_branch".to_string(), "open_issues_count".to_string(), "is_template".to_string(), "topics".to_string(), "has_issues".to_string(), "has_projects".to_string(), "has_wiki".to_string(), "has_pages".to_string(), "has_downloads".to_string(), "archived".to_string(), "disabled".to_string(), "visibility".to_string(), "pushed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "permissions".to_string(), "allow_rebase_merge".to_string(), "template_repository".to_string(), "temp_clone_token".to_string(), "allow_squash_merge".to_string(), "allow_auto_merge".to_string(), "delete_branch_on_merge".to_string(), "allow_merge_commit".to_string(), "allow_update_branch".to_string(), "use_squash_pr_title_as_default".to_string(), "allow_forking".to_string(), "subscribers_count".to_string(), "network_count".to_string(), "license".to_string(), "organization".to_string(), "parent".to_string(), "source".to_string(), "forks".to_string(), "master_branch".to_string(), "open_issues".to_string(), "watchers".to_string(), "anonymous_access_enabled".to_string(), "code_of_conduct".to_string(), "security_and_analysis".to_string(), ] } } #[doc = "An artifact"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Artifact { pub id: i64, pub node_id: String, #[doc = "The name of the artifact."] pub name: String, #[doc = "The size in bytes of the artifact."] pub size_in_bytes: i64, pub url: String, pub archive_download_url: String, #[doc = "Whether or not the artifact has expired."] pub expired: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub expires_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub workflow_run: Option, } impl std::fmt::Display for Artifact { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Artifact { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), format!("{:?}", self.size_in_bytes), self.url.clone(), self.archive_download_url.clone(), format!("{:?}", self.expired), format!("{:?}", self.created_at), format!("{:?}", self.expires_at), format!("{:?}", self.updated_at), if let Some(workflow_run) = &self.workflow_run { format!("{:?}", workflow_run) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "size_in_bytes".to_string(), "url".to_string(), "archive_download_url".to_string(), "expired".to_string(), "created_at".to_string(), "expires_at".to_string(), "updated_at".to_string(), "workflow_run".to_string(), ] } } #[doc = "Repository actions caches"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsCacheList { #[doc = "Total number of caches"] pub total_count: i64, #[doc = "Array of caches"] pub actions_caches: Vec, } impl std::fmt::Display for ActionsCacheList { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsCacheList { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.total_count), format!("{:?}", self.actions_caches), ] } fn headers() -> Vec { vec!["total_count".to_string(), "actions_caches".to_string()] } } #[doc = "Information of a job execution in a workflow run"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Job { #[doc = "The id of the job."] pub id: i64, #[doc = "The id of the associated workflow run."] pub run_id: i64, pub run_url: String, #[doc = "Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub run_attempt: Option, pub node_id: String, #[doc = "The SHA of the commit that is being run."] pub head_sha: String, pub url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[doc = "The phase of the lifecycle that the job is currently in."] pub status: Status, #[doc = "The outcome of the job."] #[serde(default, skip_serializing_if = "Option::is_none")] pub conclusion: Option, #[doc = "The time that the job started, in ISO 8601 format."] pub started_at: chrono::DateTime, #[doc = "The time that the job finished, in ISO 8601 format."] #[serde(default, skip_serializing_if = "Option::is_none")] pub completed_at: Option>, #[doc = "The name of the job."] pub name: String, #[doc = "Steps in this job."] #[serde(default, skip_serializing_if = "Option::is_none")] pub steps: Option>, pub check_run_url: String, #[doc = "Labels for the workflow job. Specified by the \"runs_on\" attribute in the action's workflow file."] pub labels: Vec, #[doc = "The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub runner_id: Option, #[doc = "The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub runner_name: Option, #[doc = "The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub runner_group_id: Option, #[doc = "The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub runner_group_name: Option, } impl std::fmt::Display for Job { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Job { const LENGTH: usize = 20; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.run_id), self.run_url.clone(), if let Some(run_attempt) = &self.run_attempt { format!("{:?}", run_attempt) } else { String::new() }, self.node_id.clone(), self.head_sha.clone(), self.url.clone(), format!("{:?}", self.html_url), format!("{:?}", self.status), format!("{:?}", self.conclusion), format!("{:?}", self.started_at), format!("{:?}", self.completed_at), self.name.clone(), if let Some(steps) = &self.steps { format!("{:?}", steps) } else { String::new() }, self.check_run_url.clone(), format!("{:?}", self.labels), format!("{:?}", self.runner_id), format!("{:?}", self.runner_name), format!("{:?}", self.runner_group_id), format!("{:?}", self.runner_group_name), ] } fn headers() -> Vec { vec![ "id".to_string(), "run_id".to_string(), "run_url".to_string(), "run_attempt".to_string(), "node_id".to_string(), "head_sha".to_string(), "url".to_string(), "html_url".to_string(), "status".to_string(), "conclusion".to_string(), "started_at".to_string(), "completed_at".to_string(), "name".to_string(), "steps".to_string(), "check_run_url".to_string(), "labels".to_string(), "runner_id".to_string(), "runner_name".to_string(), "runner_group_id".to_string(), "runner_group_name".to_string(), ] } } #[doc = "OIDC Customer Subject"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct OptOutOidcCustomSub { pub use_default: bool, } impl std::fmt::Display for OptOutOidcCustomSub { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for OptOutOidcCustomSub { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![format!("{:?}", self.use_default)] } fn headers() -> Vec { vec!["use_default".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsRepositoryPermissions { #[doc = "Whether GitHub Actions is enabled on the repository."] pub enabled: bool, #[doc = "The permissions policy that controls the actions and reusable workflows that are allowed to run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub allowed_actions: Option, #[doc = "The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub selected_actions_url: Option, } impl std::fmt::Display for ActionsRepositoryPermissions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsRepositoryPermissions { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.enabled), if let Some(allowed_actions) = &self.allowed_actions { format!("{:?}", allowed_actions) } else { String::new() }, if let Some(selected_actions_url) = &self.selected_actions_url { format!("{:?}", selected_actions_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "enabled".to_string(), "allowed_actions".to_string(), "selected_actions_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsWorkflowAccessToRepository { #[doc = "Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the\nrepository. `none` means access is only possible from workflows in this repository."] pub access_level: AccessLevel, } impl std::fmt::Display for ActionsWorkflowAccessToRepository { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsWorkflowAccessToRepository { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![format!("{:?}", self.access_level)] } fn headers() -> Vec { vec!["access_level".to_string()] } } #[doc = "A workflow referenced/reused by the initial caller workflow"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ReferencedWorkflow { pub path: String, pub sha: String, #[serde(rename = "ref", default, skip_serializing_if = "Option::is_none")] pub ref_: Option, } impl std::fmt::Display for ReferencedWorkflow { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ReferencedWorkflow { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.path.clone(), self.sha.clone(), if let Some(ref_) = &self.ref_ { format!("{:?}", ref_) } else { String::new() }, ] } fn headers() -> Vec { vec!["path".to_string(), "sha".to_string(), "ref_".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PullRequestMinimal { pub id: i64, pub number: i64, pub url: String, pub head: Head, pub base: Base, } impl std::fmt::Display for PullRequestMinimal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PullRequestMinimal { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.number), self.url.clone(), format!("{:?}", self.head), format!("{:?}", self.base), ] } fn headers() -> Vec { vec![ "id".to_string(), "number".to_string(), "url".to_string(), "head".to_string(), "base".to_string(), ] } } #[doc = "Simple Commit"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableSimpleCommit { pub id: String, pub tree_id: String, pub message: String, pub timestamp: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub author: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, } impl std::fmt::Display for NullableSimpleCommit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableSimpleCommit { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.id.clone(), self.tree_id.clone(), self.message.clone(), format!("{:?}", self.timestamp), format!("{:?}", self.author), format!("{:?}", self.committer), ] } fn headers() -> Vec { vec![ "id".to_string(), "tree_id".to_string(), "message".to_string(), "timestamp".to_string(), "author".to_string(), "committer".to_string(), ] } } #[doc = "An invocation of a workflow"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct WorkflowRun { #[doc = "The ID of the workflow run."] pub id: i64, #[doc = "The name of the workflow run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, pub node_id: String, #[doc = "The ID of the associated check suite."] #[serde(default, skip_serializing_if = "Option::is_none")] pub check_suite_id: Option, #[doc = "The node ID of the associated check suite."] #[serde(default, skip_serializing_if = "Option::is_none")] pub check_suite_node_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub head_branch: Option, #[doc = "The SHA of the head commit that points to the version of the workflow being run."] pub head_sha: String, #[doc = "The full path of the workflow"] pub path: String, #[doc = "The auto incrementing run number for the workflow run."] pub run_number: i64, #[doc = "Attempt number of the run, 1 for first attempt and higher if the workflow was re-run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub run_attempt: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub referenced_workflows: Option>, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub conclusion: Option, #[doc = "The ID of the parent workflow."] pub workflow_id: i64, #[doc = "The URL to the workflow run."] pub url: String, pub html_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub pull_requests: Option>, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub actor: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub triggering_actor: Option, #[doc = "The start time of the latest run. Resets on re-run."] #[serde(default, skip_serializing_if = "Option::is_none")] pub run_started_at: Option>, #[doc = "The URL to the jobs for the workflow run."] pub jobs_url: String, #[doc = "The URL to download the logs for the workflow run."] pub logs_url: String, #[doc = "The URL to the associated check suite."] pub check_suite_url: String, #[doc = "The URL to the artifacts for the workflow run."] pub artifacts_url: String, #[doc = "The URL to cancel the workflow run."] pub cancel_url: String, #[doc = "The URL to rerun the workflow run."] pub rerun_url: String, #[doc = "The URL to the previous attempted run of this workflow, if one exists."] #[serde(default, skip_serializing_if = "Option::is_none")] pub previous_attempt_url: Option, #[doc = "The URL to the workflow."] pub workflow_url: String, #[doc = "Simple Commit"] #[serde(default, skip_serializing_if = "Option::is_none")] pub head_commit: Option, #[doc = "Minimal Repository"] pub repository: MinimalRepository, #[doc = "Minimal Repository"] pub head_repository: MinimalRepository, #[serde(default, skip_serializing_if = "Option::is_none")] pub head_repository_id: Option, } impl std::fmt::Display for WorkflowRun { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for WorkflowRun { const LENGTH: usize = 35; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, self.node_id.clone(), if let Some(check_suite_id) = &self.check_suite_id { format!("{:?}", check_suite_id) } else { String::new() }, if let Some(check_suite_node_id) = &self.check_suite_node_id { format!("{:?}", check_suite_node_id) } else { String::new() }, format!("{:?}", self.head_branch), self.head_sha.clone(), self.path.clone(), format!("{:?}", self.run_number), if let Some(run_attempt) = &self.run_attempt { format!("{:?}", run_attempt) } else { String::new() }, if let Some(referenced_workflows) = &self.referenced_workflows { format!("{:?}", referenced_workflows) } else { String::new() }, self.event.clone(), format!("{:?}", self.status), format!("{:?}", self.conclusion), format!("{:?}", self.workflow_id), self.url.clone(), self.html_url.clone(), format!("{:?}", self.pull_requests), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(actor) = &self.actor { format!("{:?}", actor) } else { String::new() }, if let Some(triggering_actor) = &self.triggering_actor { format!("{:?}", triggering_actor) } else { String::new() }, if let Some(run_started_at) = &self.run_started_at { format!("{:?}", run_started_at) } else { String::new() }, self.jobs_url.clone(), self.logs_url.clone(), self.check_suite_url.clone(), self.artifacts_url.clone(), self.cancel_url.clone(), self.rerun_url.clone(), if let Some(previous_attempt_url) = &self.previous_attempt_url { format!("{:?}", previous_attempt_url) } else { String::new() }, self.workflow_url.clone(), format!("{:?}", self.head_commit), format!("{:?}", self.repository), format!("{:?}", self.head_repository), if let Some(head_repository_id) = &self.head_repository_id { format!("{:?}", head_repository_id) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "node_id".to_string(), "check_suite_id".to_string(), "check_suite_node_id".to_string(), "head_branch".to_string(), "head_sha".to_string(), "path".to_string(), "run_number".to_string(), "run_attempt".to_string(), "referenced_workflows".to_string(), "event".to_string(), "status".to_string(), "conclusion".to_string(), "workflow_id".to_string(), "url".to_string(), "html_url".to_string(), "pull_requests".to_string(), "created_at".to_string(), "updated_at".to_string(), "actor".to_string(), "triggering_actor".to_string(), "run_started_at".to_string(), "jobs_url".to_string(), "logs_url".to_string(), "check_suite_url".to_string(), "artifacts_url".to_string(), "cancel_url".to_string(), "rerun_url".to_string(), "previous_attempt_url".to_string(), "workflow_url".to_string(), "head_commit".to_string(), "repository".to_string(), "head_repository".to_string(), "head_repository_id".to_string(), ] } } #[doc = "An entry in the reviews log for environment deployments"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct EnvironmentApprovals { #[doc = "The list of environments that were approved or rejected"] pub environments: Vec, #[doc = "Whether deployment to the environment(s) was approved or rejected"] pub state: State, #[doc = "Simple User"] pub user: SimpleUser, #[doc = "The comment submitted with the deployment review"] pub comment: String, } impl std::fmt::Display for EnvironmentApprovals { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for EnvironmentApprovals { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.environments), format!("{:?}", self.state), format!("{:?}", self.user), self.comment.clone(), ] } fn headers() -> Vec { vec![ "environments".to_string(), "state".to_string(), "user".to_string(), "comment".to_string(), ] } } #[doc = "The type of reviewer."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum DeploymentReviewerType { User, Team, } #[doc = "Details of a deployment that is waiting for protection rules to pass"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PendingDeployment { pub environment: Environment, #[doc = "The set duration of the wait timer"] pub wait_timer: i64, #[doc = "The time that the wait timer began."] #[serde(default, skip_serializing_if = "Option::is_none")] pub wait_timer_started_at: Option>, #[doc = "Whether the currently authenticated user can approve the deployment"] pub current_user_can_approve: bool, #[doc = "The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed."] pub reviewers: Vec, } impl std::fmt::Display for PendingDeployment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PendingDeployment { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.environment), format!("{:?}", self.wait_timer), format!("{:?}", self.wait_timer_started_at), format!("{:?}", self.current_user_can_approve), format!("{:?}", self.reviewers), ] } fn headers() -> Vec { vec![ "environment".to_string(), "wait_timer".to_string(), "wait_timer_started_at".to_string(), "current_user_can_approve".to_string(), "reviewers".to_string(), ] } } #[doc = "A request for a specific ref(branch,sha,tag) to be deployed"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Deployment { pub url: url::Url, #[doc = "Unique identifier of the deployment"] pub id: i64, pub node_id: String, pub sha: String, #[doc = "The ref to deploy. This can be a branch, tag, or sha."] #[serde(rename = "ref")] pub ref_: String, #[doc = "Parameter to specify a task to execute"] pub task: String, pub payload: Payload, #[serde(default, skip_serializing_if = "Option::is_none")] pub original_environment: Option, #[doc = "Name for the target deployment environment."] pub environment: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub statuses_url: url::Url, pub repository_url: url::Url, #[doc = "Specifies if the given environment is will no longer exist at some point in the future. Default: false."] #[serde(default, skip_serializing_if = "Option::is_none")] pub transient_environment: Option, #[doc = "Specifies if the given environment is one that end-users directly interact with. Default: false."] #[serde(default, skip_serializing_if = "Option::is_none")] pub production_environment: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, } impl std::fmt::Display for Deployment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Deployment { const LENGTH: usize = 18; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), self.sha.clone(), self.ref_.clone(), self.task.clone(), format!("{:?}", self.payload), if let Some(original_environment) = &self.original_environment { format!("{:?}", original_environment) } else { String::new() }, self.environment.clone(), format!("{:?}", self.description), format!("{:?}", self.creator), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.statuses_url), format!("{:?}", self.repository_url), if let Some(transient_environment) = &self.transient_environment { format!("{:?}", transient_environment) } else { String::new() }, if let Some(production_environment) = &self.production_environment { format!("{:?}", production_environment) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "node_id".to_string(), "sha".to_string(), "ref_".to_string(), "task".to_string(), "payload".to_string(), "original_environment".to_string(), "environment".to_string(), "description".to_string(), "creator".to_string(), "created_at".to_string(), "updated_at".to_string(), "statuses_url".to_string(), "repository_url".to_string(), "transient_environment".to_string(), "production_environment".to_string(), "performed_via_github_app".to_string(), ] } } #[doc = "Workflow Run Usage"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct WorkflowRunUsage { pub billable: Billable, #[serde(default, skip_serializing_if = "Option::is_none")] pub run_duration_ms: Option, } impl std::fmt::Display for WorkflowRunUsage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for WorkflowRunUsage { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.billable), if let Some(run_duration_ms) = &self.run_duration_ms { format!("{:?}", run_duration_ms) } else { String::new() }, ] } fn headers() -> Vec { vec!["billable".to_string(), "run_duration_ms".to_string()] } } #[doc = "Set secrets for GitHub Actions."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ActionsSecret { #[doc = "The name of the secret."] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for ActionsSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ActionsSecret { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[doc = "A GitHub Actions workflow"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Workflow { pub id: i64, pub node_id: String, pub name: String, pub path: String, pub state: State, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub url: String, pub html_url: String, pub badge_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub deleted_at: Option>, } impl std::fmt::Display for Workflow { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Workflow { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.path.clone(), format!("{:?}", self.state), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), self.url.clone(), self.html_url.clone(), self.badge_url.clone(), if let Some(deleted_at) = &self.deleted_at { format!("{:?}", deleted_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "path".to_string(), "state".to_string(), "created_at".to_string(), "updated_at".to_string(), "url".to_string(), "html_url".to_string(), "badge_url".to_string(), "deleted_at".to_string(), ] } } #[doc = "Workflow Usage"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct WorkflowUsage { pub billable: Billable, } impl std::fmt::Display for WorkflowUsage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for WorkflowUsage { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![format!("{:?}", self.billable)] } fn headers() -> Vec { vec!["billable".to_string()] } } #[doc = "An autolink reference."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Autolink { pub id: i64, #[doc = "The prefix of a key that is linkified."] pub key_prefix: String, #[doc = "A template for the target URL that is generated if a key was found."] pub url_template: String, #[doc = "Whether this autolink reference matches alphanumeric characters. If false, this autolink reference is a legacy autolink that only matches numeric characters."] #[serde(default, skip_serializing_if = "Option::is_none")] pub is_alphanumeric: Option, } impl std::fmt::Display for Autolink { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Autolink { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.key_prefix.clone(), self.url_template.clone(), if let Some(is_alphanumeric) = &self.is_alphanumeric { format!("{:?}", is_alphanumeric) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "key_prefix".to_string(), "url_template".to_string(), "is_alphanumeric".to_string(), ] } } #[doc = "Protected Branch Required Status Check"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProtectedBranchRequiredStatusCheck { #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub enforcement_level: Option, pub contexts: Vec, pub checks: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub contexts_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub strict: Option, } impl std::fmt::Display for ProtectedBranchRequiredStatusCheck { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProtectedBranchRequiredStatusCheck { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(enforcement_level) = &self.enforcement_level { format!("{:?}", enforcement_level) } else { String::new() }, format!("{:?}", self.contexts), format!("{:?}", self.checks), if let Some(contexts_url) = &self.contexts_url { format!("{:?}", contexts_url) } else { String::new() }, if let Some(strict) = &self.strict { format!("{:?}", strict) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "enforcement_level".to_string(), "contexts".to_string(), "checks".to_string(), "contexts_url".to_string(), "strict".to_string(), ] } } #[doc = "Protected Branch Admin Enforced"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProtectedBranchAdminEnforced { pub url: url::Url, pub enabled: bool, } impl std::fmt::Display for ProtectedBranchAdminEnforced { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProtectedBranchAdminEnforced { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.url), format!("{:?}", self.enabled)] } fn headers() -> Vec { vec!["url".to_string(), "enabled".to_string()] } } #[doc = "Protected Branch Pull Request Review"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProtectedBranchPullRequestReview { #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissal_restrictions: Option, #[doc = "Allow specific users, teams, or apps to bypass pull request requirements."] #[serde(default, skip_serializing_if = "Option::is_none")] pub bypass_pull_request_allowances: Option, pub dismiss_stale_reviews: bool, pub require_code_owner_reviews: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_approving_review_count: Option, } impl std::fmt::Display for ProtectedBranchPullRequestReview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProtectedBranchPullRequestReview { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(dismissal_restrictions) = &self.dismissal_restrictions { format!("{:?}", dismissal_restrictions) } else { String::new() }, if let Some(bypass_pull_request_allowances) = &self.bypass_pull_request_allowances { format!("{:?}", bypass_pull_request_allowances) } else { String::new() }, format!("{:?}", self.dismiss_stale_reviews), format!("{:?}", self.require_code_owner_reviews), if let Some(required_approving_review_count) = &self.required_approving_review_count { format!("{:?}", required_approving_review_count) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "dismissal_restrictions".to_string(), "bypass_pull_request_allowances".to_string(), "dismiss_stale_reviews".to_string(), "require_code_owner_reviews".to_string(), "required_approving_review_count".to_string(), ] } } #[doc = "Branch Restriction Policy"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BranchRestrictionPolicy { pub url: url::Url, pub users_url: url::Url, pub teams_url: url::Url, pub apps_url: url::Url, pub users: Vec, pub teams: Vec, pub apps: Vec, } impl std::fmt::Display for BranchRestrictionPolicy { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BranchRestrictionPolicy { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.users_url), format!("{:?}", self.teams_url), format!("{:?}", self.apps_url), format!("{:?}", self.users), format!("{:?}", self.teams), format!("{:?}", self.apps), ] } fn headers() -> Vec { vec![ "url".to_string(), "users_url".to_string(), "teams_url".to_string(), "apps_url".to_string(), "users".to_string(), "teams".to_string(), "apps".to_string(), ] } } #[doc = "Branch Protection"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BranchProtection { #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub enabled: Option, #[doc = "Protected Branch Required Status Check"] #[serde(default, skip_serializing_if = "Option::is_none")] pub required_status_checks: Option, #[doc = "Protected Branch Admin Enforced"] #[serde(default, skip_serializing_if = "Option::is_none")] pub enforce_admins: Option, #[doc = "Protected Branch Pull Request Review"] #[serde(default, skip_serializing_if = "Option::is_none")] pub required_pull_request_reviews: Option, #[doc = "Branch Restriction Policy"] #[serde(default, skip_serializing_if = "Option::is_none")] pub restrictions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_linear_history: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_force_pushes: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_deletions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub block_creations: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_conversation_resolution: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub protection_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_signatures: Option, } impl std::fmt::Display for BranchProtection { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BranchProtection { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(enabled) = &self.enabled { format!("{:?}", enabled) } else { String::new() }, if let Some(required_status_checks) = &self.required_status_checks { format!("{:?}", required_status_checks) } else { String::new() }, if let Some(enforce_admins) = &self.enforce_admins { format!("{:?}", enforce_admins) } else { String::new() }, if let Some(required_pull_request_reviews) = &self.required_pull_request_reviews { format!("{:?}", required_pull_request_reviews) } else { String::new() }, if let Some(restrictions) = &self.restrictions { format!("{:?}", restrictions) } else { String::new() }, if let Some(required_linear_history) = &self.required_linear_history { format!("{:?}", required_linear_history) } else { String::new() }, if let Some(allow_force_pushes) = &self.allow_force_pushes { format!("{:?}", allow_force_pushes) } else { String::new() }, if let Some(allow_deletions) = &self.allow_deletions { format!("{:?}", allow_deletions) } else { String::new() }, if let Some(block_creations) = &self.block_creations { format!("{:?}", block_creations) } else { String::new() }, if let Some(required_conversation_resolution) = &self.required_conversation_resolution { format!("{:?}", required_conversation_resolution) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(protection_url) = &self.protection_url { format!("{:?}", protection_url) } else { String::new() }, if let Some(required_signatures) = &self.required_signatures { format!("{:?}", required_signatures) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "enabled".to_string(), "required_status_checks".to_string(), "enforce_admins".to_string(), "required_pull_request_reviews".to_string(), "restrictions".to_string(), "required_linear_history".to_string(), "allow_force_pushes".to_string(), "allow_deletions".to_string(), "block_creations".to_string(), "required_conversation_resolution".to_string(), "name".to_string(), "protection_url".to_string(), "required_signatures".to_string(), ] } } #[doc = "Short Branch"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ShortBranch { pub name: String, pub commit: Commit, pub protected: bool, #[doc = "Branch Protection"] #[serde(default, skip_serializing_if = "Option::is_none")] pub protection: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub protection_url: Option, } impl std::fmt::Display for ShortBranch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ShortBranch { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.commit), format!("{:?}", self.protected), if let Some(protection) = &self.protection { format!("{:?}", protection) } else { String::new() }, if let Some(protection_url) = &self.protection_url { format!("{:?}", protection_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "commit".to_string(), "protected".to_string(), "protection".to_string(), "protection_url".to_string(), ] } } #[doc = "Metaproperties for Git author/committer information."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableGitUser { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub date: Option, } impl std::fmt::Display for NullableGitUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableGitUser { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(date) = &self.date { format!("{:?}", date) } else { String::new() }, ] } fn headers() -> Vec { vec!["name".to_string(), "email".to_string(), "date".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Verification { pub verified: bool, pub reason: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub payload: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub signature: Option, } impl std::fmt::Display for Verification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Verification { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.verified), self.reason.clone(), format!("{:?}", self.payload), format!("{:?}", self.signature), ] } fn headers() -> Vec { vec![ "verified".to_string(), "reason".to_string(), "payload".to_string(), "signature".to_string(), ] } } #[doc = "Diff Entry"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DiffEntry { pub sha: String, pub filename: String, pub status: Status, pub additions: i64, pub deletions: i64, pub changes: i64, pub blob_url: url::Url, pub raw_url: url::Url, pub contents_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub patch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub previous_filename: Option, } impl std::fmt::Display for DiffEntry { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DiffEntry { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.sha.clone(), self.filename.clone(), format!("{:?}", self.status), format!("{:?}", self.additions), format!("{:?}", self.deletions), format!("{:?}", self.changes), format!("{:?}", self.blob_url), format!("{:?}", self.raw_url), format!("{:?}", self.contents_url), if let Some(patch) = &self.patch { format!("{:?}", patch) } else { String::new() }, if let Some(previous_filename) = &self.previous_filename { format!("{:?}", previous_filename) } else { String::new() }, ] } fn headers() -> Vec { vec![ "sha".to_string(), "filename".to_string(), "status".to_string(), "additions".to_string(), "deletions".to_string(), "changes".to_string(), "blob_url".to_string(), "raw_url".to_string(), "contents_url".to_string(), "patch".to_string(), "previous_filename".to_string(), ] } } #[doc = "Commit"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Commit { pub url: url::Url, pub sha: String, pub node_id: String, pub html_url: url::Url, pub comments_url: url::Url, pub commit: Commit, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub author: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, pub parents: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub stats: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub files: Option>, } impl std::fmt::Display for Commit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Commit { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), self.sha.clone(), self.node_id.clone(), format!("{:?}", self.html_url), format!("{:?}", self.comments_url), format!("{:?}", self.commit), format!("{:?}", self.author), format!("{:?}", self.committer), format!("{:?}", self.parents), if let Some(stats) = &self.stats { format!("{:?}", stats) } else { String::new() }, if let Some(files) = &self.files { format!("{:?}", files) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "sha".to_string(), "node_id".to_string(), "html_url".to_string(), "comments_url".to_string(), "commit".to_string(), "author".to_string(), "committer".to_string(), "parents".to_string(), "stats".to_string(), "files".to_string(), ] } } #[doc = "Branch With Protection"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BranchWithProtection { pub name: String, #[doc = "Commit"] pub commit: Commit, #[serde(rename = "_links")] pub links: Links, pub protected: bool, #[doc = "Branch Protection"] pub protection: BranchProtection, pub protection_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub pattern: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_approving_review_count: Option, } impl std::fmt::Display for BranchWithProtection { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BranchWithProtection { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.commit), format!("{:?}", self.links), format!("{:?}", self.protected), format!("{:?}", self.protection), format!("{:?}", self.protection_url), if let Some(pattern) = &self.pattern { format!("{:?}", pattern) } else { String::new() }, if let Some(required_approving_review_count) = &self.required_approving_review_count { format!("{:?}", required_approving_review_count) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "commit".to_string(), "links".to_string(), "protected".to_string(), "protection".to_string(), "protection_url".to_string(), "pattern".to_string(), "required_approving_review_count".to_string(), ] } } #[doc = "Status Check Policy"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct StatusCheckPolicy { pub url: url::Url, pub strict: bool, pub contexts: Vec, pub checks: Vec, pub contexts_url: url::Url, } impl std::fmt::Display for StatusCheckPolicy { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for StatusCheckPolicy { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.strict), format!("{:?}", self.contexts), format!("{:?}", self.checks), format!("{:?}", self.contexts_url), ] } fn headers() -> Vec { vec![ "url".to_string(), "strict".to_string(), "contexts".to_string(), "checks".to_string(), "contexts_url".to_string(), ] } } #[doc = "Branch protections protect branches"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ProtectedBranch { pub url: url::Url, #[doc = "Status Check Policy"] #[serde(default, skip_serializing_if = "Option::is_none")] pub required_status_checks: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_pull_request_reviews: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_signatures: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub enforce_admins: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_linear_history: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_force_pushes: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub allow_deletions: Option, #[doc = "Branch Restriction Policy"] #[serde(default, skip_serializing_if = "Option::is_none")] pub restrictions: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub required_conversation_resolution: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub block_creations: Option, } impl std::fmt::Display for ProtectedBranch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ProtectedBranch { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), if let Some(required_status_checks) = &self.required_status_checks { format!("{:?}", required_status_checks) } else { String::new() }, if let Some(required_pull_request_reviews) = &self.required_pull_request_reviews { format!("{:?}", required_pull_request_reviews) } else { String::new() }, if let Some(required_signatures) = &self.required_signatures { format!("{:?}", required_signatures) } else { String::new() }, if let Some(enforce_admins) = &self.enforce_admins { format!("{:?}", enforce_admins) } else { String::new() }, if let Some(required_linear_history) = &self.required_linear_history { format!("{:?}", required_linear_history) } else { String::new() }, if let Some(allow_force_pushes) = &self.allow_force_pushes { format!("{:?}", allow_force_pushes) } else { String::new() }, if let Some(allow_deletions) = &self.allow_deletions { format!("{:?}", allow_deletions) } else { String::new() }, if let Some(restrictions) = &self.restrictions { format!("{:?}", restrictions) } else { String::new() }, if let Some(required_conversation_resolution) = &self.required_conversation_resolution { format!("{:?}", required_conversation_resolution) } else { String::new() }, if let Some(block_creations) = &self.block_creations { format!("{:?}", block_creations) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "required_status_checks".to_string(), "required_pull_request_reviews".to_string(), "required_signatures".to_string(), "enforce_admins".to_string(), "required_linear_history".to_string(), "allow_force_pushes".to_string(), "allow_deletions".to_string(), "restrictions".to_string(), "required_conversation_resolution".to_string(), "block_creations".to_string(), ] } } #[doc = "A deployment created as the result of an Actions check run from a workflow that references an environment"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DeploymentSimple { pub url: url::Url, #[doc = "Unique identifier of the deployment"] pub id: i64, pub node_id: String, #[doc = "Parameter to specify a task to execute"] pub task: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub original_environment: Option, #[doc = "Name for the target deployment environment."] pub environment: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub statuses_url: url::Url, pub repository_url: url::Url, #[doc = "Specifies if the given environment is will no longer exist at some point in the future. Default: false."] #[serde(default, skip_serializing_if = "Option::is_none")] pub transient_environment: Option, #[doc = "Specifies if the given environment is one that end-users directly interact with. Default: false."] #[serde(default, skip_serializing_if = "Option::is_none")] pub production_environment: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, } impl std::fmt::Display for DeploymentSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DeploymentSimple { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), self.task.clone(), if let Some(original_environment) = &self.original_environment { format!("{:?}", original_environment) } else { String::new() }, self.environment.clone(), format!("{:?}", self.description), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.statuses_url), format!("{:?}", self.repository_url), if let Some(transient_environment) = &self.transient_environment { format!("{:?}", transient_environment) } else { String::new() }, if let Some(production_environment) = &self.production_environment { format!("{:?}", production_environment) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "node_id".to_string(), "task".to_string(), "original_environment".to_string(), "environment".to_string(), "description".to_string(), "created_at".to_string(), "updated_at".to_string(), "statuses_url".to_string(), "repository_url".to_string(), "transient_environment".to_string(), "production_environment".to_string(), "performed_via_github_app".to_string(), ] } } #[doc = "A check performed on the code of a given code change"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CheckRun { #[doc = "The id of the check."] pub id: i64, #[doc = "The SHA of the commit that is being checked."] pub head_sha: String, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub external_id: Option, pub url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub details_url: Option, #[doc = "The phase of the lifecycle that the check is currently in."] pub status: Status, #[serde(default, skip_serializing_if = "Option::is_none")] pub conclusion: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub started_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub completed_at: Option>, pub output: Output, #[doc = "The name of the check."] pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub check_suite: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub app: Option, pub pull_requests: Vec, #[doc = "A deployment created as the result of an Actions check run from a workflow that references an environment"] #[serde(default, skip_serializing_if = "Option::is_none")] pub deployment: Option, } impl std::fmt::Display for CheckRun { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CheckRun { const LENGTH: usize = 17; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.head_sha.clone(), self.node_id.clone(), format!("{:?}", self.external_id), self.url.clone(), format!("{:?}", self.html_url), format!("{:?}", self.details_url), format!("{:?}", self.status), format!("{:?}", self.conclusion), format!("{:?}", self.started_at), format!("{:?}", self.completed_at), format!("{:?}", self.output), self.name.clone(), format!("{:?}", self.check_suite), format!("{:?}", self.app), format!("{:?}", self.pull_requests), if let Some(deployment) = &self.deployment { format!("{:?}", deployment) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "head_sha".to_string(), "node_id".to_string(), "external_id".to_string(), "url".to_string(), "html_url".to_string(), "details_url".to_string(), "status".to_string(), "conclusion".to_string(), "started_at".to_string(), "completed_at".to_string(), "output".to_string(), "name".to_string(), "check_suite".to_string(), "app".to_string(), "pull_requests".to_string(), "deployment".to_string(), ] } } #[doc = "Check Annotation"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CheckAnnotation { pub path: String, pub start_line: i64, pub end_line: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub start_column: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub end_column: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub annotation_level: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub raw_details: Option, pub blob_href: String, } impl std::fmt::Display for CheckAnnotation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CheckAnnotation { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ self.path.clone(), format!("{:?}", self.start_line), format!("{:?}", self.end_line), format!("{:?}", self.start_column), format!("{:?}", self.end_column), format!("{:?}", self.annotation_level), format!("{:?}", self.title), format!("{:?}", self.message), format!("{:?}", self.raw_details), self.blob_href.clone(), ] } fn headers() -> Vec { vec![ "path".to_string(), "start_line".to_string(), "end_line".to_string(), "start_column".to_string(), "end_column".to_string(), "annotation_level".to_string(), "title".to_string(), "message".to_string(), "raw_details".to_string(), "blob_href".to_string(), ] } } #[doc = "Simple Commit"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SimpleCommit { pub id: String, pub tree_id: String, pub message: String, pub timestamp: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub author: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, } impl std::fmt::Display for SimpleCommit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SimpleCommit { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.id.clone(), self.tree_id.clone(), self.message.clone(), format!("{:?}", self.timestamp), format!("{:?}", self.author), format!("{:?}", self.committer), ] } fn headers() -> Vec { vec![ "id".to_string(), "tree_id".to_string(), "message".to_string(), "timestamp".to_string(), "author".to_string(), "committer".to_string(), ] } } #[doc = "A suite of checks performed on the code of a given code change"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CheckSuite { pub id: i64, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub head_branch: Option, #[doc = "The SHA of the head commit that is being checked."] pub head_sha: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub conclusion: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub before: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub after: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub pull_requests: Option>, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub app: Option, #[doc = "Minimal Repository"] pub repository: MinimalRepository, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "Simple Commit"] pub head_commit: SimpleCommit, pub latest_check_runs_count: i64, pub check_runs_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub rerequestable: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub runs_rerequestable: Option, } impl std::fmt::Display for CheckSuite { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CheckSuite { const LENGTH: usize = 19; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.head_branch), self.head_sha.clone(), format!("{:?}", self.status), format!("{:?}", self.conclusion), format!("{:?}", self.url), format!("{:?}", self.before), format!("{:?}", self.after), format!("{:?}", self.pull_requests), format!("{:?}", self.app), format!("{:?}", self.repository), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.head_commit), format!("{:?}", self.latest_check_runs_count), self.check_runs_url.clone(), if let Some(rerequestable) = &self.rerequestable { format!("{:?}", rerequestable) } else { String::new() }, if let Some(runs_rerequestable) = &self.runs_rerequestable { format!("{:?}", runs_rerequestable) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "head_branch".to_string(), "head_sha".to_string(), "status".to_string(), "conclusion".to_string(), "url".to_string(), "before".to_string(), "after".to_string(), "pull_requests".to_string(), "app".to_string(), "repository".to_string(), "created_at".to_string(), "updated_at".to_string(), "head_commit".to_string(), "latest_check_runs_count".to_string(), "check_runs_url".to_string(), "rerequestable".to_string(), "runs_rerequestable".to_string(), ] } } #[doc = "Check suite configuration preferences for a repository."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CheckSuitePreference { pub preferences: Preferences, #[doc = "Minimal Repository"] pub repository: MinimalRepository, } impl std::fmt::Display for CheckSuitePreference { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CheckSuitePreference { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.preferences), format!("{:?}", self.repository), ] } fn headers() -> Vec { vec!["preferences".to_string(), "repository".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlertRuleSummary { #[doc = "A unique identifier for the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "The name of the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[doc = "A set of tags applicable for the rule."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option>, #[doc = "The severity of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub severity: Option, #[doc = "A short description of the rule used to detect the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, } impl std::fmt::Display for CodeScanningAlertRuleSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlertRuleSummary { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, if let Some(tags) = &self.tags { format!("{:?}", tags) } else { String::new() }, if let Some(severity) = &self.severity { format!("{:?}", severity) } else { String::new() }, if let Some(description) = &self.description { format!("{:?}", description) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "name".to_string(), "tags".to_string(), "severity".to_string(), "description".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlertItems { #[doc = "The security alert number."] pub number: i64, #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] pub created_at: chrono::DateTime, #[doc = "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "The REST API URL of the alert resource."] pub url: url::Url, #[doc = "The GitHub URL of the alert resource."] pub html_url: url::Url, #[doc = "The REST API URL for fetching the list of instances for an alert."] pub instances_url: url::Url, #[doc = "State of a code scanning alert."] pub state: CodeScanningAlertState, #[doc = "The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub fixed_at: Option>, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_by: Option, #[doc = "The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_at: Option>, #[doc = "**Required when the state is dismissed.** The reason for dismissing or closing the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_reason: Option, #[doc = "The dismissal comment associated with the dismissal of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_comment: Option, pub rule: CodeScanningAlertRuleSummary, pub tool: CodeScanningAnalysisTool, pub most_recent_instance: CodeScanningAlertInstance, } impl std::fmt::Display for CodeScanningAlertItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlertItems { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ format!("{:?}", self.number), format!("{:?}", self.created_at), if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.instances_url), format!("{:?}", self.state), if let Some(fixed_at) = &self.fixed_at { format!("{:?}", fixed_at) } else { String::new() }, format!("{:?}", self.dismissed_by), format!("{:?}", self.dismissed_at), format!("{:?}", self.dismissed_reason), if let Some(dismissed_comment) = &self.dismissed_comment { format!("{:?}", dismissed_comment) } else { String::new() }, format!("{:?}", self.rule), format!("{:?}", self.tool), format!("{:?}", self.most_recent_instance), ] } fn headers() -> Vec { vec![ "number".to_string(), "created_at".to_string(), "updated_at".to_string(), "url".to_string(), "html_url".to_string(), "instances_url".to_string(), "state".to_string(), "fixed_at".to_string(), "dismissed_by".to_string(), "dismissed_at".to_string(), "dismissed_reason".to_string(), "dismissed_comment".to_string(), "rule".to_string(), "tool".to_string(), "most_recent_instance".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAlert { #[doc = "The security alert number."] pub number: i64, #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] pub created_at: chrono::DateTime, #[doc = "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[doc = "The REST API URL of the alert resource."] pub url: url::Url, #[doc = "The GitHub URL of the alert resource."] pub html_url: url::Url, #[doc = "The REST API URL for fetching the list of instances for an alert."] pub instances_url: url::Url, #[doc = "State of a code scanning alert."] pub state: CodeScanningAlertState, #[doc = "The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub fixed_at: Option>, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_by: Option, #[doc = "The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_at: Option>, #[doc = "**Required when the state is dismissed.** The reason for dismissing or closing the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_reason: Option, #[doc = "The dismissal comment associated with the dismissal of the alert."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_comment: Option, pub rule: CodeScanningAlertRule, pub tool: CodeScanningAnalysisTool, pub most_recent_instance: CodeScanningAlertInstance, } impl std::fmt::Display for CodeScanningAlert { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAlert { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ format!("{:?}", self.number), format!("{:?}", self.created_at), if let Some(updated_at) = &self.updated_at { format!("{:?}", updated_at) } else { String::new() }, format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.instances_url), format!("{:?}", self.state), if let Some(fixed_at) = &self.fixed_at { format!("{:?}", fixed_at) } else { String::new() }, format!("{:?}", self.dismissed_by), format!("{:?}", self.dismissed_at), format!("{:?}", self.dismissed_reason), if let Some(dismissed_comment) = &self.dismissed_comment { format!("{:?}", dismissed_comment) } else { String::new() }, format!("{:?}", self.rule), format!("{:?}", self.tool), format!("{:?}", self.most_recent_instance), ] } fn headers() -> Vec { vec![ "number".to_string(), "created_at".to_string(), "updated_at".to_string(), "url".to_string(), "html_url".to_string(), "instances_url".to_string(), "state".to_string(), "fixed_at".to_string(), "dismissed_by".to_string(), "dismissed_at".to_string(), "dismissed_reason".to_string(), "dismissed_comment".to_string(), "rule".to_string(), "tool".to_string(), "most_recent_instance".to_string(), ] } } #[doc = "Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Eq, Hash, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, clap :: ValueEnum, parse_display :: FromStr, parse_display :: Display, )] pub enum CodeScanningAlertSetState { #[serde(rename = "open")] #[display("open")] Open, #[serde(rename = "dismissed")] #[display("dismissed")] Dismissed, } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAnalysis { #[doc = "The full Git reference, formatted as `refs/heads/`,\n`refs/pull//merge`, or `refs/pull//head`."] #[serde(rename = "ref")] pub ref_: String, #[doc = "The SHA of the commit to which the analysis you are uploading relates."] pub commit_sha: String, #[doc = "Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name."] pub analysis_key: String, #[doc = "Identifies the variable values associated with the environment in which this analysis was performed."] pub environment: String, #[doc = "Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code."] #[serde(default, skip_serializing_if = "Option::is_none")] pub category: Option, pub error: String, #[doc = "The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] pub created_at: chrono::DateTime, #[doc = "The total number of results in the analysis."] pub results_count: i64, #[doc = "The total number of rules used in the analysis."] pub rules_count: i64, #[doc = "Unique identifier for this analysis."] pub id: i64, #[doc = "The REST API URL of the analysis resource."] pub url: url::Url, #[doc = "An identifier for the upload."] pub sarif_id: String, pub tool: CodeScanningAnalysisTool, pub deletable: bool, #[doc = "Warning generated when processing the analysis"] pub warning: String, } impl std::fmt::Display for CodeScanningAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAnalysis { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ self.ref_.clone(), self.commit_sha.clone(), self.analysis_key.clone(), self.environment.clone(), if let Some(category) = &self.category { format!("{:?}", category) } else { String::new() }, self.error.clone(), format!("{:?}", self.created_at), format!("{:?}", self.results_count), format!("{:?}", self.rules_count), format!("{:?}", self.id), format!("{:?}", self.url), self.sarif_id.clone(), format!("{:?}", self.tool), format!("{:?}", self.deletable), self.warning.clone(), ] } fn headers() -> Vec { vec![ "ref_".to_string(), "commit_sha".to_string(), "analysis_key".to_string(), "environment".to_string(), "category".to_string(), "error".to_string(), "created_at".to_string(), "results_count".to_string(), "rules_count".to_string(), "id".to_string(), "url".to_string(), "sarif_id".to_string(), "tool".to_string(), "deletable".to_string(), "warning".to_string(), ] } } #[doc = "Successful deletion of a code scanning analysis"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningAnalysisDeletion { #[doc = "Next deletable analysis in chain, without last analysis deletion confirmation"] #[serde(default, skip_serializing_if = "Option::is_none")] pub next_analysis_url: Option, #[doc = "Next deletable analysis in chain, with last analysis deletion confirmation"] #[serde(default, skip_serializing_if = "Option::is_none")] pub confirm_delete_url: Option, } impl std::fmt::Display for CodeScanningAnalysisDeletion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningAnalysisDeletion { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.next_analysis_url), format!("{:?}", self.confirm_delete_url), ] } fn headers() -> Vec { vec![ "next_analysis_url".to_string(), "confirm_delete_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningSarifsReceipt { #[doc = "An identifier for the upload."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "The REST API URL for checking the status of the upload."] #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, } impl std::fmt::Display for CodeScanningSarifsReceipt { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningSarifsReceipt { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, ] } fn headers() -> Vec { vec!["id".to_string(), "url".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeScanningSarifsStatus { #[doc = "`pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed."] #[serde(default, skip_serializing_if = "Option::is_none")] pub processing_status: Option, #[doc = "The REST API URL for getting the analyses associated with the upload."] #[serde(default, skip_serializing_if = "Option::is_none")] pub analyses_url: Option, #[doc = "Any errors that ocurred during processing of the delivery."] #[serde(default, skip_serializing_if = "Option::is_none")] pub errors: Option>, } impl std::fmt::Display for CodeScanningSarifsStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeScanningSarifsStatus { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ if let Some(processing_status) = &self.processing_status { format!("{:?}", processing_status) } else { String::new() }, if let Some(analyses_url) = &self.analyses_url { format!("{:?}", analyses_url) } else { String::new() }, if let Some(errors) = &self.errors { format!("{:?}", errors) } else { String::new() }, ] } fn headers() -> Vec { vec![ "processing_status".to_string(), "analyses_url".to_string(), "errors".to_string(), ] } } #[doc = "A list of errors found in a repo's CODEOWNERS file"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodeownersErrors { pub errors: Vec, } impl std::fmt::Display for CodeownersErrors { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodeownersErrors { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![format!("{:?}", self.errors)] } fn headers() -> Vec { vec!["errors".to_string()] } } #[doc = "A description of the machine powering a codespace."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodespaceMachine { #[doc = "The name of the machine."] pub name: String, #[doc = "The display name of the machine includes cores, memory, and storage."] pub display_name: String, #[doc = "The operating system of the machine."] pub operating_system: String, #[doc = "How much storage is available to the codespace."] pub storage_in_bytes: i64, #[doc = "How much memory is available to the codespace."] pub memory_in_bytes: i64, #[doc = "How many cores are available to the codespace."] pub cpus: i64, #[doc = "Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be \"null\" if prebuilds are not supported or prebuild availability could not be determined. Value will be \"none\" if no prebuild is available. Latest values \"ready\" and \"in_progress\" indicate the prebuild availability status."] #[serde(default, skip_serializing_if = "Option::is_none")] pub prebuild_availability: Option, } impl std::fmt::Display for CodespaceMachine { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodespaceMachine { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ self.name.clone(), self.display_name.clone(), self.operating_system.clone(), format!("{:?}", self.storage_in_bytes), format!("{:?}", self.memory_in_bytes), format!("{:?}", self.cpus), format!("{:?}", self.prebuild_availability), ] } fn headers() -> Vec { vec![ "name".to_string(), "display_name".to_string(), "operating_system".to_string(), "storage_in_bytes".to_string(), "memory_in_bytes".to_string(), "cpus".to_string(), "prebuild_availability".to_string(), ] } } #[doc = "Set repository secrets for GitHub Codespaces."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RepoCodespacesSecret { #[doc = "The name of the secret."] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for RepoCodespacesSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RepoCodespacesSecret { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[doc = "The public key used for setting Codespaces secrets."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CodespacesPublicKey { #[doc = "The identifier for the key."] pub key_id: String, #[doc = "The Base64 encoded public key."] pub key: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option, } impl std::fmt::Display for CodespacesPublicKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CodespacesPublicKey { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ self.key_id.clone(), self.key.clone(), if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(title) = &self.title { format!("{:?}", title) } else { String::new() }, if let Some(created_at) = &self.created_at { format!("{:?}", created_at) } else { String::new() }, ] } fn headers() -> Vec { vec![ "key_id".to_string(), "key".to_string(), "id".to_string(), "url".to_string(), "title".to_string(), "created_at".to_string(), ] } } #[doc = "Collaborator"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Collaborator { pub login: String, pub id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, pub node_id: String, pub avatar_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub html_url: url::Url, pub followers_url: url::Url, pub following_url: String, pub gists_url: String, pub starred_url: String, pub subscriptions_url: url::Url, pub organizations_url: url::Url, pub repos_url: url::Url, pub events_url: String, pub received_events_url: url::Url, #[serde(rename = "type")] pub type_: String, pub site_admin: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, pub role_name: String, } impl std::fmt::Display for Collaborator { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Collaborator { const LENGTH: usize = 22; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.id), if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, self.node_id.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.followers_url), self.following_url.clone(), self.gists_url.clone(), self.starred_url.clone(), format!("{:?}", self.subscriptions_url), format!("{:?}", self.organizations_url), format!("{:?}", self.repos_url), self.events_url.clone(), format!("{:?}", self.received_events_url), self.type_.clone(), format!("{:?}", self.site_admin), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, self.role_name.clone(), ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "email".to_string(), "name".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "permissions".to_string(), "role_name".to_string(), ] } } #[doc = "Repository invitations let you manage who you collaborate with."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RepositoryInvitation { #[doc = "Unique identifier of the repository invitation."] pub id: i64, #[doc = "Minimal Repository"] pub repository: MinimalRepository, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub invitee: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub inviter: Option, #[doc = "The permission associated with the invitation."] pub permissions: Permissions, pub created_at: chrono::DateTime, #[doc = "Whether or not the invitation has expired"] #[serde(default, skip_serializing_if = "Option::is_none")] pub expired: Option, #[doc = "URL for the repository invitation"] pub url: String, pub html_url: String, pub node_id: String, } impl std::fmt::Display for RepositoryInvitation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RepositoryInvitation { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), format!("{:?}", self.repository), format!("{:?}", self.invitee), format!("{:?}", self.inviter), format!("{:?}", self.permissions), format!("{:?}", self.created_at), if let Some(expired) = &self.expired { format!("{:?}", expired) } else { String::new() }, self.url.clone(), self.html_url.clone(), self.node_id.clone(), ] } fn headers() -> Vec { vec![ "id".to_string(), "repository".to_string(), "invitee".to_string(), "inviter".to_string(), "permissions".to_string(), "created_at".to_string(), "expired".to_string(), "url".to_string(), "html_url".to_string(), "node_id".to_string(), ] } } #[doc = "Collaborator"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableCollaborator { pub login: String, pub id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, pub node_id: String, pub avatar_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, pub url: url::Url, pub html_url: url::Url, pub followers_url: url::Url, pub following_url: String, pub gists_url: String, pub starred_url: String, pub subscriptions_url: url::Url, pub organizations_url: url::Url, pub repos_url: url::Url, pub events_url: String, pub received_events_url: url::Url, #[serde(rename = "type")] pub type_: String, pub site_admin: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, pub role_name: String, } impl std::fmt::Display for NullableCollaborator { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableCollaborator { const LENGTH: usize = 22; fn fields(&self) -> Vec { vec![ self.login.clone(), format!("{:?}", self.id), if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, self.node_id.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.gravatar_id), format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.followers_url), self.following_url.clone(), self.gists_url.clone(), self.starred_url.clone(), format!("{:?}", self.subscriptions_url), format!("{:?}", self.organizations_url), format!("{:?}", self.repos_url), self.events_url.clone(), format!("{:?}", self.received_events_url), self.type_.clone(), format!("{:?}", self.site_admin), if let Some(permissions) = &self.permissions { format!("{:?}", permissions) } else { String::new() }, self.role_name.clone(), ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "email".to_string(), "name".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "permissions".to_string(), "role_name".to_string(), ] } } #[doc = "Repository Collaborator Permission"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RepositoryCollaboratorPermission { pub permission: String, pub role_name: String, #[doc = "Collaborator"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, } impl std::fmt::Display for RepositoryCollaboratorPermission { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RepositoryCollaboratorPermission { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.permission.clone(), self.role_name.clone(), format!("{:?}", self.user), ] } fn headers() -> Vec { vec![ "permission".to_string(), "role_name".to_string(), "user".to_string(), ] } } #[doc = "Commit Comment"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CommitComment { pub html_url: url::Url, pub url: url::Url, pub id: i64, pub node_id: String, pub body: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub path: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub position: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub line: Option, pub commit_id: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for CommitComment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CommitComment { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ format!("{:?}", self.html_url), format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), self.body.clone(), format!("{:?}", self.path), format!("{:?}", self.position), format!("{:?}", self.line), self.commit_id.clone(), format!("{:?}", self.user), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.author_association), if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "html_url".to_string(), "url".to_string(), "id".to_string(), "node_id".to_string(), "body".to_string(), "path".to_string(), "position".to_string(), "line".to_string(), "commit_id".to_string(), "user".to_string(), "created_at".to_string(), "updated_at".to_string(), "author_association".to_string(), "reactions".to_string(), ] } } #[doc = "Branch Short"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct BranchShort { pub name: String, pub commit: Commit, pub protected: bool, } impl std::fmt::Display for BranchShort { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for BranchShort { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.commit), format!("{:?}", self.protected), ] } fn headers() -> Vec { vec![ "name".to_string(), "commit".to_string(), "protected".to_string(), ] } } #[doc = "Hypermedia Link"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Link { pub href: String, } impl std::fmt::Display for Link { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Link { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![self.href.clone()] } fn headers() -> Vec { vec!["href".to_string()] } } #[doc = "The status of auto merging a pull request."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AutoMerge { #[doc = "Simple User"] pub enabled_by: SimpleUser, #[doc = "The merge method to use."] pub merge_method: MergeMethod, #[doc = "Title for the merge commit message."] pub commit_title: String, #[doc = "Commit message for the merge commit."] pub commit_message: String, } impl std::fmt::Display for AutoMerge { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AutoMerge { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.enabled_by), format!("{:?}", self.merge_method), self.commit_title.clone(), self.commit_message.clone(), ] } fn headers() -> Vec { vec![ "enabled_by".to_string(), "merge_method".to_string(), "commit_title".to_string(), "commit_message".to_string(), ] } } #[doc = "Pull Request Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PullRequestSimple { pub url: url::Url, pub id: i64, pub node_id: String, pub html_url: url::Url, pub diff_url: url::Url, pub patch_url: url::Url, pub issue_url: url::Url, pub commits_url: url::Url, pub review_comments_url: url::Url, pub review_comment_url: String, pub comments_url: url::Url, pub statuses_url: url::Url, pub number: i64, pub state: String, pub locked: bool, pub title: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, pub labels: Vec, #[doc = "A collection of related issues and pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub active_lock_reason: Option, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub merged_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub merge_commit_sha: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub assignees: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_reviewers: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_teams: Option>, pub head: Head, pub base: Base, #[serde(rename = "_links")] pub links: Links, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, #[doc = "The status of auto merging a pull request."] #[serde(default, skip_serializing_if = "Option::is_none")] pub auto_merge: Option, #[doc = "Indicates whether or not the pull request is a draft."] #[serde(default, skip_serializing_if = "Option::is_none")] pub draft: Option, } impl std::fmt::Display for PullRequestSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PullRequestSimple { const LENGTH: usize = 36; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.html_url), format!("{:?}", self.diff_url), format!("{:?}", self.patch_url), format!("{:?}", self.issue_url), format!("{:?}", self.commits_url), format!("{:?}", self.review_comments_url), self.review_comment_url.clone(), format!("{:?}", self.comments_url), format!("{:?}", self.statuses_url), format!("{:?}", self.number), self.state.clone(), format!("{:?}", self.locked), self.title.clone(), format!("{:?}", self.user), format!("{:?}", self.body), format!("{:?}", self.labels), format!("{:?}", self.milestone), if let Some(active_lock_reason) = &self.active_lock_reason { format!("{:?}", active_lock_reason) } else { String::new() }, format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.closed_at), format!("{:?}", self.merged_at), format!("{:?}", self.merge_commit_sha), format!("{:?}", self.assignee), if let Some(assignees) = &self.assignees { format!("{:?}", assignees) } else { String::new() }, if let Some(requested_reviewers) = &self.requested_reviewers { format!("{:?}", requested_reviewers) } else { String::new() }, if let Some(requested_teams) = &self.requested_teams { format!("{:?}", requested_teams) } else { String::new() }, format!("{:?}", self.head), format!("{:?}", self.base), format!("{:?}", self.links), format!("{:?}", self.author_association), format!("{:?}", self.auto_merge), if let Some(draft) = &self.draft { format!("{:?}", draft) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "node_id".to_string(), "html_url".to_string(), "diff_url".to_string(), "patch_url".to_string(), "issue_url".to_string(), "commits_url".to_string(), "review_comments_url".to_string(), "review_comment_url".to_string(), "comments_url".to_string(), "statuses_url".to_string(), "number".to_string(), "state".to_string(), "locked".to_string(), "title".to_string(), "user".to_string(), "body".to_string(), "labels".to_string(), "milestone".to_string(), "active_lock_reason".to_string(), "created_at".to_string(), "updated_at".to_string(), "closed_at".to_string(), "merged_at".to_string(), "merge_commit_sha".to_string(), "assignee".to_string(), "assignees".to_string(), "requested_reviewers".to_string(), "requested_teams".to_string(), "head".to_string(), "base".to_string(), "links".to_string(), "author_association".to_string(), "auto_merge".to_string(), "draft".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct SimpleCommitStatus { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, pub id: i64, pub node_id: String, pub state: String, pub context: String, pub target_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub required: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub avatar_url: Option, pub url: url::Url, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for SimpleCommitStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for SimpleCommitStatus { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.description), format!("{:?}", self.id), self.node_id.clone(), self.state.clone(), self.context.clone(), format!("{:?}", self.target_url), if let Some(required) = &self.required { format!("{:?}", required) } else { String::new() }, format!("{:?}", self.avatar_url), format!("{:?}", self.url), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "description".to_string(), "id".to_string(), "node_id".to_string(), "state".to_string(), "context".to_string(), "target_url".to_string(), "required".to_string(), "avatar_url".to_string(), "url".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[doc = "Combined Commit Status"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CombinedCommitStatus { pub state: String, pub statuses: Vec, pub sha: String, pub total_count: i64, #[doc = "Minimal Repository"] pub repository: MinimalRepository, pub commit_url: url::Url, pub url: url::Url, } impl std::fmt::Display for CombinedCommitStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CombinedCommitStatus { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ self.state.clone(), format!("{:?}", self.statuses), self.sha.clone(), format!("{:?}", self.total_count), format!("{:?}", self.repository), format!("{:?}", self.commit_url), format!("{:?}", self.url), ] } fn headers() -> Vec { vec![ "state".to_string(), "statuses".to_string(), "sha".to_string(), "total_count".to_string(), "repository".to_string(), "commit_url".to_string(), "url".to_string(), ] } } #[doc = "The status of a commit."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Status { pub url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub avatar_url: Option, pub id: i64, pub node_id: String, pub state: String, pub description: String, pub target_url: String, pub context: String, pub created_at: String, pub updated_at: String, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, } impl std::fmt::Display for Status { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Status { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.url.clone(), format!("{:?}", self.avatar_url), format!("{:?}", self.id), self.node_id.clone(), self.state.clone(), self.description.clone(), self.target_url.clone(), self.context.clone(), self.created_at.clone(), self.updated_at.clone(), format!("{:?}", self.creator), ] } fn headers() -> Vec { vec![ "url".to_string(), "avatar_url".to_string(), "id".to_string(), "node_id".to_string(), "state".to_string(), "description".to_string(), "target_url".to_string(), "context".to_string(), "created_at".to_string(), "updated_at".to_string(), "creator".to_string(), ] } } #[doc = "Code of Conduct Simple"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableCodeOfConductSimple { pub url: url::Url, pub key: String, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, } impl std::fmt::Display for NullableCodeOfConductSimple { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableCodeOfConductSimple { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), self.key.clone(), self.name.clone(), format!("{:?}", self.html_url), ] } fn headers() -> Vec { vec![ "url".to_string(), "key".to_string(), "name".to_string(), "html_url".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableCommunityHealthFile { pub url: url::Url, pub html_url: url::Url, } impl std::fmt::Display for NullableCommunityHealthFile { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableCommunityHealthFile { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.url), format!("{:?}", self.html_url)] } fn headers() -> Vec { vec!["url".to_string(), "html_url".to_string()] } } #[doc = "Community Profile"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CommunityProfile { pub health_percentage: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub documentation: Option, pub files: Files, #[serde(default, skip_serializing_if = "Option::is_none")] pub updated_at: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub content_reports_enabled: Option, } impl std::fmt::Display for CommunityProfile { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CommunityProfile { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ format!("{:?}", self.health_percentage), format!("{:?}", self.description), format!("{:?}", self.documentation), format!("{:?}", self.files), format!("{:?}", self.updated_at), if let Some(content_reports_enabled) = &self.content_reports_enabled { format!("{:?}", content_reports_enabled) } else { String::new() }, ] } fn headers() -> Vec { vec![ "health_percentage".to_string(), "description".to_string(), "documentation".to_string(), "files".to_string(), "updated_at".to_string(), "content_reports_enabled".to_string(), ] } } #[doc = "Commit Comparison"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct CommitComparison { pub url: url::Url, pub html_url: url::Url, pub permalink_url: url::Url, pub diff_url: url::Url, pub patch_url: url::Url, #[doc = "Commit"] pub base_commit: Commit, #[doc = "Commit"] pub merge_base_commit: Commit, pub status: Status, pub ahead_by: i64, pub behind_by: i64, pub total_commits: i64, pub commits: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub files: Option>, } impl std::fmt::Display for CommitComparison { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for CommitComparison { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.permalink_url), format!("{:?}", self.diff_url), format!("{:?}", self.patch_url), format!("{:?}", self.base_commit), format!("{:?}", self.merge_base_commit), format!("{:?}", self.status), format!("{:?}", self.ahead_by), format!("{:?}", self.behind_by), format!("{:?}", self.total_commits), format!("{:?}", self.commits), if let Some(files) = &self.files { format!("{:?}", files) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "html_url".to_string(), "permalink_url".to_string(), "diff_url".to_string(), "patch_url".to_string(), "base_commit".to_string(), "merge_base_commit".to_string(), "status".to_string(), "ahead_by".to_string(), "behind_by".to_string(), "total_commits".to_string(), "commits".to_string(), "files".to_string(), ] } } #[doc = "Content Tree"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ContentTree { #[serde(rename = "type")] pub type_: String, pub size: i64, pub name: String, pub path: String, pub sha: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub entries: Option>, #[serde(rename = "_links")] pub links: Links, } impl std::fmt::Display for ContentTree { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ContentTree { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.type_.clone(), format!("{:?}", self.size), self.name.clone(), self.path.clone(), self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.git_url), format!("{:?}", self.html_url), format!("{:?}", self.download_url), if let Some(entries) = &self.entries { format!("{:?}", entries) } else { String::new() }, format!("{:?}", self.links), ] } fn headers() -> Vec { vec![ "type_".to_string(), "size".to_string(), "name".to_string(), "path".to_string(), "sha".to_string(), "url".to_string(), "git_url".to_string(), "html_url".to_string(), "download_url".to_string(), "entries".to_string(), "links".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ContentDirectory { #[serde(rename = "type")] pub type_: String, pub size: i64, pub name: String, pub path: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub content: Option, pub sha: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, #[serde(rename = "_links")] pub links: Links, } impl std::fmt::Display for ContentDirectory { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ContentDirectory { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.type_.clone(), format!("{:?}", self.size), self.name.clone(), self.path.clone(), if let Some(content) = &self.content { format!("{:?}", content) } else { String::new() }, self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.git_url), format!("{:?}", self.html_url), format!("{:?}", self.download_url), format!("{:?}", self.links), ] } fn headers() -> Vec { vec![ "type_".to_string(), "size".to_string(), "name".to_string(), "path".to_string(), "content".to_string(), "sha".to_string(), "url".to_string(), "git_url".to_string(), "html_url".to_string(), "download_url".to_string(), "links".to_string(), ] } } #[doc = "Content File"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ContentFile { #[serde(rename = "type")] pub type_: String, pub encoding: String, pub size: i64, pub name: String, pub path: String, pub content: String, pub sha: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, #[serde(rename = "_links")] pub links: Links, #[serde(default, skip_serializing_if = "Option::is_none")] pub target: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub submodule_git_url: Option, } impl std::fmt::Display for ContentFile { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ContentFile { const LENGTH: usize = 14; fn fields(&self) -> Vec { vec![ self.type_.clone(), self.encoding.clone(), format!("{:?}", self.size), self.name.clone(), self.path.clone(), self.content.clone(), self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.git_url), format!("{:?}", self.html_url), format!("{:?}", self.download_url), format!("{:?}", self.links), if let Some(target) = &self.target { format!("{:?}", target) } else { String::new() }, if let Some(submodule_git_url) = &self.submodule_git_url { format!("{:?}", submodule_git_url) } else { String::new() }, ] } fn headers() -> Vec { vec![ "type_".to_string(), "encoding".to_string(), "size".to_string(), "name".to_string(), "path".to_string(), "content".to_string(), "sha".to_string(), "url".to_string(), "git_url".to_string(), "html_url".to_string(), "download_url".to_string(), "links".to_string(), "target".to_string(), "submodule_git_url".to_string(), ] } } #[doc = "An object describing a symlink"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ContentSymlink { #[serde(rename = "type")] pub type_: String, pub target: String, pub size: i64, pub name: String, pub path: String, pub sha: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, #[serde(rename = "_links")] pub links: Links, } impl std::fmt::Display for ContentSymlink { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ContentSymlink { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.type_.clone(), self.target.clone(), format!("{:?}", self.size), self.name.clone(), self.path.clone(), self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.git_url), format!("{:?}", self.html_url), format!("{:?}", self.download_url), format!("{:?}", self.links), ] } fn headers() -> Vec { vec![ "type_".to_string(), "target".to_string(), "size".to_string(), "name".to_string(), "path".to_string(), "sha".to_string(), "url".to_string(), "git_url".to_string(), "html_url".to_string(), "download_url".to_string(), "links".to_string(), ] } } #[doc = "An object describing a symlink"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ContentSubmodule { #[serde(rename = "type")] pub type_: String, pub submodule_git_url: url::Url, pub size: i64, pub name: String, pub path: String, pub sha: String, pub url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub git_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, #[serde(rename = "_links")] pub links: Links, } impl std::fmt::Display for ContentSubmodule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ContentSubmodule { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ self.type_.clone(), format!("{:?}", self.submodule_git_url), format!("{:?}", self.size), self.name.clone(), self.path.clone(), self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.git_url), format!("{:?}", self.html_url), format!("{:?}", self.download_url), format!("{:?}", self.links), ] } fn headers() -> Vec { vec![ "type_".to_string(), "submodule_git_url".to_string(), "size".to_string(), "name".to_string(), "path".to_string(), "sha".to_string(), "url".to_string(), "git_url".to_string(), "html_url".to_string(), "download_url".to_string(), "links".to_string(), ] } } #[doc = "File Commit"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct FileCommit { #[serde(default, skip_serializing_if = "Option::is_none")] pub content: Option, pub commit: Commit, } impl std::fmt::Display for FileCommit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for FileCommit { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.content), format!("{:?}", self.commit)] } fn headers() -> Vec { vec!["content".to_string(), "commit".to_string()] } } #[doc = "Contributor"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Contributor { #[serde(default, skip_serializing_if = "Option::is_none")] pub login: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub node_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub avatar_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub gravatar_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub html_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub followers_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub following_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub gists_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub starred_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub subscriptions_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub organizations_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub repos_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub events_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub received_events_url: Option, #[serde(rename = "type")] pub type_: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub site_admin: Option, pub contributions: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, } impl std::fmt::Display for Contributor { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Contributor { const LENGTH: usize = 21; fn fields(&self) -> Vec { vec![ if let Some(login) = &self.login { format!("{:?}", login) } else { String::new() }, if let Some(id) = &self.id { format!("{:?}", id) } else { String::new() }, if let Some(node_id) = &self.node_id { format!("{:?}", node_id) } else { String::new() }, if let Some(avatar_url) = &self.avatar_url { format!("{:?}", avatar_url) } else { String::new() }, if let Some(gravatar_id) = &self.gravatar_id { format!("{:?}", gravatar_id) } else { String::new() }, if let Some(url) = &self.url { format!("{:?}", url) } else { String::new() }, if let Some(html_url) = &self.html_url { format!("{:?}", html_url) } else { String::new() }, if let Some(followers_url) = &self.followers_url { format!("{:?}", followers_url) } else { String::new() }, if let Some(following_url) = &self.following_url { format!("{:?}", following_url) } else { String::new() }, if let Some(gists_url) = &self.gists_url { format!("{:?}", gists_url) } else { String::new() }, if let Some(starred_url) = &self.starred_url { format!("{:?}", starred_url) } else { String::new() }, if let Some(subscriptions_url) = &self.subscriptions_url { format!("{:?}", subscriptions_url) } else { String::new() }, if let Some(organizations_url) = &self.organizations_url { format!("{:?}", organizations_url) } else { String::new() }, if let Some(repos_url) = &self.repos_url { format!("{:?}", repos_url) } else { String::new() }, if let Some(events_url) = &self.events_url { format!("{:?}", events_url) } else { String::new() }, if let Some(received_events_url) = &self.received_events_url { format!("{:?}", received_events_url) } else { String::new() }, self.type_.clone(), if let Some(site_admin) = &self.site_admin { format!("{:?}", site_admin) } else { String::new() }, format!("{:?}", self.contributions), if let Some(email) = &self.email { format!("{:?}", email) } else { String::new() }, if let Some(name) = &self.name { format!("{:?}", name) } else { String::new() }, ] } fn headers() -> Vec { vec![ "login".to_string(), "id".to_string(), "node_id".to_string(), "avatar_url".to_string(), "gravatar_id".to_string(), "url".to_string(), "html_url".to_string(), "followers_url".to_string(), "following_url".to_string(), "gists_url".to_string(), "starred_url".to_string(), "subscriptions_url".to_string(), "organizations_url".to_string(), "repos_url".to_string(), "events_url".to_string(), "received_events_url".to_string(), "type_".to_string(), "site_admin".to_string(), "contributions".to_string(), "email".to_string(), "name".to_string(), ] } } #[doc = "Set secrets for Dependabot."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DependabotSecret { #[doc = "The name of the secret."] pub name: String, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, } impl std::fmt::Display for DependabotSecret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DependabotSecret { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ self.name.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), ] } fn headers() -> Vec { vec![ "name".to_string(), "created_at".to_string(), "updated_at".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DependencyGraphDiff { pub change_type: ChangeType, pub manifest: String, pub ecosystem: String, pub name: String, pub version: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub package_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub license: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub source_repository_url: Option, pub vulnerabilities: Vec, } impl std::fmt::Display for DependencyGraphDiff { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DependencyGraphDiff { const LENGTH: usize = 9; fn fields(&self) -> Vec { vec![ format!("{:?}", self.change_type), self.manifest.clone(), self.ecosystem.clone(), self.name.clone(), self.version.clone(), format!("{:?}", self.package_url), format!("{:?}", self.license), format!("{:?}", self.source_repository_url), format!("{:?}", self.vulnerabilities), ] } fn headers() -> Vec { vec![ "change_type".to_string(), "manifest".to_string(), "ecosystem".to_string(), "name".to_string(), "version".to_string(), "package_url".to_string(), "license".to_string(), "source_repository_url".to_string(), "vulnerabilities".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, tabled :: Tabled, )] pub enum Metadata { String(String), f64(f64), bool(bool), } #[doc = "A single package dependency."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Dependency { #[doc = "Package-url (PURL) of dependency. See https://github.com/package-url/purl-spec for more details."] #[serde(default, skip_serializing_if = "Option::is_none")] pub package_url: Option, #[doc = "User-defined metadata to store domain-specific information limited to 8 keys with scalar values."] #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option>>, #[doc = "A notation of whether a dependency is requested directly by this manifest or is a dependency of another dependency."] #[serde(default, skip_serializing_if = "Option::is_none")] pub relationship: Option, #[doc = "A notation of whether the dependency is required for the primary build artifact (runtime) or is only used for development. Future versions of this specification may allow for more granular scopes."] #[serde(default, skip_serializing_if = "Option::is_none")] pub scope: Option, #[doc = "Array of package-url (PURLs) of direct child dependencies."] #[serde(default, skip_serializing_if = "Option::is_none")] pub dependencies: Option>, } impl std::fmt::Display for Dependency { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Dependency { const LENGTH: usize = 5; fn fields(&self) -> Vec { vec![ if let Some(package_url) = &self.package_url { format!("{:?}", package_url) } else { String::new() }, if let Some(metadata) = &self.metadata { format!("{:?}", metadata) } else { String::new() }, if let Some(relationship) = &self.relationship { format!("{:?}", relationship) } else { String::new() }, if let Some(scope) = &self.scope { format!("{:?}", scope) } else { String::new() }, if let Some(dependencies) = &self.dependencies { format!("{:?}", dependencies) } else { String::new() }, ] } fn headers() -> Vec { vec![ "package_url".to_string(), "metadata".to_string(), "relationship".to_string(), "scope".to_string(), "dependencies".to_string(), ] } } #[doc = "A collection of related dependencies declared in a file or representing a logical group of dependencies."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Manifest { #[doc = "The name of the manifest."] pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub file: Option, #[doc = "User-defined metadata to store domain-specific information limited to 8 keys with scalar values."] #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub resolved: Option, } impl std::fmt::Display for Manifest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Manifest { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ self.name.clone(), if let Some(file) = &self.file { format!("{:?}", file) } else { String::new() }, if let Some(metadata) = &self.metadata { format!("{:?}", metadata) } else { String::new() }, if let Some(resolved) = &self.resolved { format!("{:?}", resolved) } else { String::new() }, ] } fn headers() -> Vec { vec![ "name".to_string(), "file".to_string(), "metadata".to_string(), "resolved".to_string(), ] } } #[doc = "Create a new snapshot of a repository's dependencies."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Snapshot { #[doc = "The version of the repository snapshot submission."] pub version: i64, pub job: Job, #[doc = "The commit SHA associated with this dependency snapshot."] pub sha: String, #[doc = "The repository branch that triggered this snapshot."] #[serde(rename = "ref")] pub ref_: String, #[doc = "A description of the detector used."] pub detector: Detector, #[doc = "User-defined metadata to store domain-specific information limited to 8 keys with scalar values."] #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option>>, #[doc = "A collection of package manifests"] #[serde(default, skip_serializing_if = "Option::is_none")] pub manifests: Option>, #[doc = "The time at which the snapshot was scanned."] pub scanned: chrono::DateTime, } impl std::fmt::Display for Snapshot { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Snapshot { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ format!("{:?}", self.version), format!("{:?}", self.job), self.sha.clone(), self.ref_.clone(), format!("{:?}", self.detector), if let Some(metadata) = &self.metadata { format!("{:?}", metadata) } else { String::new() }, if let Some(manifests) = &self.manifests { format!("{:?}", manifests) } else { String::new() }, format!("{:?}", self.scanned), ] } fn headers() -> Vec { vec![ "version".to_string(), "job".to_string(), "sha".to_string(), "ref_".to_string(), "detector".to_string(), "metadata".to_string(), "manifests".to_string(), "scanned".to_string(), ] } } #[doc = "The status of a deployment."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DeploymentStatus { pub url: url::Url, pub id: i64, pub node_id: String, #[doc = "The state of the status."] pub state: State, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub creator: Option, #[doc = "A short description of the status."] pub description: String, #[doc = "The environment of the deployment that the status is for."] #[serde(default, skip_serializing_if = "Option::is_none")] pub environment: Option, #[doc = "Deprecated: the URL to associate with this status."] pub target_url: url::Url, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, pub deployment_url: url::Url, pub repository_url: url::Url, #[doc = "The URL for accessing your environment."] #[serde(default, skip_serializing_if = "Option::is_none")] pub environment_url: Option, #[doc = "The URL to associate with this status."] #[serde(default, skip_serializing_if = "Option::is_none")] pub log_url: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, } impl std::fmt::Display for DeploymentStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DeploymentStatus { const LENGTH: usize = 15; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.state), format!("{:?}", self.creator), self.description.clone(), if let Some(environment) = &self.environment { format!("{:?}", environment) } else { String::new() }, format!("{:?}", self.target_url), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), format!("{:?}", self.deployment_url), format!("{:?}", self.repository_url), if let Some(environment_url) = &self.environment_url { format!("{:?}", environment_url) } else { String::new() }, if let Some(log_url) = &self.log_url { format!("{:?}", log_url) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "node_id".to_string(), "state".to_string(), "creator".to_string(), "description".to_string(), "environment".to_string(), "target_url".to_string(), "created_at".to_string(), "updated_at".to_string(), "deployment_url".to_string(), "repository_url".to_string(), "environment_url".to_string(), "log_url".to_string(), "performed_via_github_app".to_string(), ] } } #[doc = "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DeploymentBranchPolicy { #[doc = "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`."] pub protected_branches: bool, #[doc = "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`."] pub custom_branch_policies: bool, } impl std::fmt::Display for DeploymentBranchPolicy { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DeploymentBranchPolicy { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![ format!("{:?}", self.protected_branches), format!("{:?}", self.custom_branch_policies), ] } fn headers() -> Vec { vec![ "protected_branches".to_string(), "custom_branch_policies".to_string(), ] } } #[doc = "Details of a deployment environment"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Environment { #[doc = "The id of the environment."] pub id: i64, pub node_id: String, #[doc = "The name of the environment."] pub name: String, pub url: String, pub html_url: String, #[doc = "The time that the environment was created, in ISO 8601 format."] pub created_at: chrono::DateTime, #[doc = "The time that the environment was last updated, in ISO 8601 format."] pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub protection_rules: Option>, #[doc = "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`."] #[serde(default, skip_serializing_if = "Option::is_none")] pub deployment_branch_policy: Option, } impl std::fmt::Display for Environment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Environment { const LENGTH: usize = 9; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.name.clone(), self.url.clone(), self.html_url.clone(), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(protection_rules) = &self.protection_rules { format!("{:?}", protection_rules) } else { String::new() }, if let Some(deployment_branch_policy) = &self.deployment_branch_policy { format!("{:?}", deployment_branch_policy) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "name".to_string(), "url".to_string(), "html_url".to_string(), "created_at".to_string(), "updated_at".to_string(), "protection_rules".to_string(), "deployment_branch_policy".to_string(), ] } } #[doc = "Short Blob"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ShortBlob { pub url: String, pub sha: String, } impl std::fmt::Display for ShortBlob { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ShortBlob { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.url.clone(), self.sha.clone()] } fn headers() -> Vec { vec!["url".to_string(), "sha".to_string()] } } #[doc = "Blob"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Blob { pub content: String, pub encoding: String, pub url: url::Url, pub sha: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub size: Option, pub node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub highlighted_content: Option, } impl std::fmt::Display for Blob { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Blob { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ self.content.clone(), self.encoding.clone(), format!("{:?}", self.url), self.sha.clone(), format!("{:?}", self.size), self.node_id.clone(), if let Some(highlighted_content) = &self.highlighted_content { format!("{:?}", highlighted_content) } else { String::new() }, ] } fn headers() -> Vec { vec![ "content".to_string(), "encoding".to_string(), "url".to_string(), "sha".to_string(), "size".to_string(), "node_id".to_string(), "highlighted_content".to_string(), ] } } #[doc = "Low-level Git commit operations within a repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GitCommit { #[doc = "SHA for the commit"] pub sha: String, pub node_id: String, pub url: url::Url, #[doc = "Identifying information for the git-user"] pub author: Author, #[doc = "Identifying information for the git-user"] pub committer: Committer, #[doc = "Message describing the purpose of the commit"] pub message: String, pub tree: Tree, pub parents: Vec, pub verification: Verification, pub html_url: url::Url, } impl std::fmt::Display for GitCommit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GitCommit { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ self.sha.clone(), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.author), format!("{:?}", self.committer), self.message.clone(), format!("{:?}", self.tree), format!("{:?}", self.parents), format!("{:?}", self.verification), format!("{:?}", self.html_url), ] } fn headers() -> Vec { vec![ "sha".to_string(), "node_id".to_string(), "url".to_string(), "author".to_string(), "committer".to_string(), "message".to_string(), "tree".to_string(), "parents".to_string(), "verification".to_string(), "html_url".to_string(), ] } } #[doc = "Git references within a repository"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GitRef { #[serde(rename = "ref")] pub ref_: String, pub node_id: String, pub url: url::Url, pub object: Object, } impl std::fmt::Display for GitRef { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GitRef { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ self.ref_.clone(), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.object), ] } fn headers() -> Vec { vec![ "ref_".to_string(), "node_id".to_string(), "url".to_string(), "object".to_string(), ] } } #[doc = "Metadata for a Git tag"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GitTag { pub node_id: String, #[doc = "Name of the tag"] pub tag: String, pub sha: String, #[doc = "URL for the tag"] pub url: url::Url, #[doc = "Message describing the purpose of the tag"] pub message: String, pub tagger: Tagger, pub object: Object, #[serde(default, skip_serializing_if = "Option::is_none")] pub verification: Option, } impl std::fmt::Display for GitTag { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GitTag { const LENGTH: usize = 8; fn fields(&self) -> Vec { vec![ self.node_id.clone(), self.tag.clone(), self.sha.clone(), format!("{:?}", self.url), self.message.clone(), format!("{:?}", self.tagger), format!("{:?}", self.object), if let Some(verification) = &self.verification { format!("{:?}", verification) } else { String::new() }, ] } fn headers() -> Vec { vec![ "node_id".to_string(), "tag".to_string(), "sha".to_string(), "url".to_string(), "message".to_string(), "tagger".to_string(), "object".to_string(), "verification".to_string(), ] } } #[doc = "The hierarchy between files in a Git repository."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct GitTree { pub sha: String, pub url: url::Url, pub truncated: bool, #[doc = "Objects specifying a tree structure"] pub tree: Vec, } impl std::fmt::Display for GitTree { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for GitTree { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ self.sha.clone(), format!("{:?}", self.url), format!("{:?}", self.truncated), format!("{:?}", self.tree), ] } fn headers() -> Vec { vec![ "sha".to_string(), "url".to_string(), "truncated".to_string(), "tree".to_string(), ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct HookResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub code: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, } impl std::fmt::Display for HookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for HookResponse { const LENGTH: usize = 3; fn fields(&self) -> Vec { vec![ format!("{:?}", self.code), format!("{:?}", self.status), format!("{:?}", self.message), ] } fn headers() -> Vec { vec![ "code".to_string(), "status".to_string(), "message".to_string(), ] } } #[doc = "Webhooks for repositories."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Hook { #[serde(rename = "type")] pub type_: String, #[doc = "Unique identifier of the webhook."] pub id: i64, #[doc = "The name of a valid service, use 'web' for a webhook."] pub name: String, #[doc = "Determines whether the hook is actually triggered on pushes."] pub active: bool, #[doc = "Determines what events the hook is triggered for. Default: ['push']."] pub events: Vec, pub config: Config, pub updated_at: chrono::DateTime, pub created_at: chrono::DateTime, pub url: url::Url, pub test_url: url::Url, pub ping_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub deliveries_url: Option, pub last_response: HookResponse, } impl std::fmt::Display for Hook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Hook { const LENGTH: usize = 13; fn fields(&self) -> Vec { vec![ self.type_.clone(), format!("{:?}", self.id), self.name.clone(), format!("{:?}", self.active), format!("{:?}", self.events), format!("{:?}", self.config), format!("{:?}", self.updated_at), format!("{:?}", self.created_at), format!("{:?}", self.url), format!("{:?}", self.test_url), format!("{:?}", self.ping_url), if let Some(deliveries_url) = &self.deliveries_url { format!("{:?}", deliveries_url) } else { String::new() }, format!("{:?}", self.last_response), ] } fn headers() -> Vec { vec![ "type_".to_string(), "id".to_string(), "name".to_string(), "active".to_string(), "events".to_string(), "config".to_string(), "updated_at".to_string(), "created_at".to_string(), "url".to_string(), "test_url".to_string(), "ping_url".to_string(), "deliveries_url".to_string(), "last_response".to_string(), ] } } #[doc = "A repository import from an external source."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct Import { #[serde(default, skip_serializing_if = "Option::is_none")] pub vcs: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub use_lfs: Option, #[doc = "The URL of the originating repository."] pub vcs_url: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub svc_root: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub tfvc_project: Option, pub status: Status, #[serde(default, skip_serializing_if = "Option::is_none")] pub status_text: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub failed_step: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub error_message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub import_percent: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub push_percent: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub has_large_files: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub large_files_size: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub large_files_count: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_choices: Option>, #[serde(default, skip_serializing_if = "Option::is_none")] pub message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub authors_count: Option, pub url: url::Url, pub html_url: url::Url, pub authors_url: url::Url, pub repository_url: url::Url, #[serde(default, skip_serializing_if = "Option::is_none")] pub svn_root: Option, } impl std::fmt::Display for Import { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for Import { const LENGTH: usize = 23; fn fields(&self) -> Vec { vec![ format!("{:?}", self.vcs), if let Some(use_lfs) = &self.use_lfs { format!("{:?}", use_lfs) } else { String::new() }, self.vcs_url.clone(), if let Some(svc_root) = &self.svc_root { format!("{:?}", svc_root) } else { String::new() }, if let Some(tfvc_project) = &self.tfvc_project { format!("{:?}", tfvc_project) } else { String::new() }, format!("{:?}", self.status), if let Some(status_text) = &self.status_text { format!("{:?}", status_text) } else { String::new() }, if let Some(failed_step) = &self.failed_step { format!("{:?}", failed_step) } else { String::new() }, if let Some(error_message) = &self.error_message { format!("{:?}", error_message) } else { String::new() }, if let Some(import_percent) = &self.import_percent { format!("{:?}", import_percent) } else { String::new() }, if let Some(commit_count) = &self.commit_count { format!("{:?}", commit_count) } else { String::new() }, if let Some(push_percent) = &self.push_percent { format!("{:?}", push_percent) } else { String::new() }, if let Some(has_large_files) = &self.has_large_files { format!("{:?}", has_large_files) } else { String::new() }, if let Some(large_files_size) = &self.large_files_size { format!("{:?}", large_files_size) } else { String::new() }, if let Some(large_files_count) = &self.large_files_count { format!("{:?}", large_files_count) } else { String::new() }, if let Some(project_choices) = &self.project_choices { format!("{:?}", project_choices) } else { String::new() }, if let Some(message) = &self.message { format!("{:?}", message) } else { String::new() }, if let Some(authors_count) = &self.authors_count { format!("{:?}", authors_count) } else { String::new() }, format!("{:?}", self.url), format!("{:?}", self.html_url), format!("{:?}", self.authors_url), format!("{:?}", self.repository_url), if let Some(svn_root) = &self.svn_root { format!("{:?}", svn_root) } else { String::new() }, ] } fn headers() -> Vec { vec![ "vcs".to_string(), "use_lfs".to_string(), "vcs_url".to_string(), "svc_root".to_string(), "tfvc_project".to_string(), "status".to_string(), "status_text".to_string(), "failed_step".to_string(), "error_message".to_string(), "import_percent".to_string(), "commit_count".to_string(), "push_percent".to_string(), "has_large_files".to_string(), "large_files_size".to_string(), "large_files_count".to_string(), "project_choices".to_string(), "message".to_string(), "authors_count".to_string(), "url".to_string(), "html_url".to_string(), "authors_url".to_string(), "repository_url".to_string(), "svn_root".to_string(), ] } } #[doc = "Porter Author"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PorterAuthor { pub id: i64, pub remote_id: String, pub remote_name: String, pub email: String, pub name: String, pub url: url::Url, pub import_url: url::Url, } impl std::fmt::Display for PorterAuthor { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PorterAuthor { const LENGTH: usize = 7; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.remote_id.clone(), self.remote_name.clone(), self.email.clone(), self.name.clone(), format!("{:?}", self.url), format!("{:?}", self.import_url), ] } fn headers() -> Vec { vec![ "id".to_string(), "remote_id".to_string(), "remote_name".to_string(), "email".to_string(), "name".to_string(), "url".to_string(), "import_url".to_string(), ] } } #[doc = "Porter Large File"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct PorterLargeFile { pub ref_name: String, pub path: String, pub oid: String, pub size: i64, } impl std::fmt::Display for PorterLargeFile { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for PorterLargeFile { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ self.ref_name.clone(), self.path.clone(), self.oid.clone(), format!("{:?}", self.size), ] } fn headers() -> Vec { vec![ "ref_name".to_string(), "path".to_string(), "oid".to_string(), "size".to_string(), ] } } #[doc = "Issues are a great way to keep track of tasks, enhancements, and bugs for your projects."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct NullableIssue { pub id: i64, pub node_id: String, #[doc = "URL for the issue"] pub url: url::Url, pub repository_url: url::Url, pub labels_url: String, pub comments_url: url::Url, pub events_url: url::Url, pub html_url: url::Url, #[doc = "Number uniquely identifying the issue within its repository"] pub number: i64, #[doc = "State of the issue; either 'open' or 'closed'"] pub state: String, #[doc = "The reason for the current state"] #[serde(default, skip_serializing_if = "Option::is_none")] pub state_reason: Option, #[doc = "Title of the issue"] pub title: String, #[doc = "Contents of the issue"] #[serde(default, skip_serializing_if = "Option::is_none")] pub body: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, #[doc = "Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository"] pub labels: Vec, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub assignees: Option>, #[doc = "A collection of related issues and pull requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, pub locked: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub active_lock_reason: Option, pub comments: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub pull_request: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_at: Option>, pub created_at: chrono::DateTime, pub updated_at: chrono::DateTime, #[serde(default, skip_serializing_if = "Option::is_none")] pub draft: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub closed_by: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_html: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub body_text: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub timeline_url: Option, #[doc = "A git repository"] #[serde(default, skip_serializing_if = "Option::is_none")] pub repository: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[doc = "How the author is associated with the repository."] pub author_association: AuthorAssociation, #[serde(default, skip_serializing_if = "Option::is_none")] pub reactions: Option, } impl std::fmt::Display for NullableIssue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for NullableIssue { const LENGTH: usize = 34; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.repository_url), self.labels_url.clone(), format!("{:?}", self.comments_url), format!("{:?}", self.events_url), format!("{:?}", self.html_url), format!("{:?}", self.number), self.state.clone(), if let Some(state_reason) = &self.state_reason { format!("{:?}", state_reason) } else { String::new() }, self.title.clone(), if let Some(body) = &self.body { format!("{:?}", body) } else { String::new() }, format!("{:?}", self.user), format!("{:?}", self.labels), format!("{:?}", self.assignee), if let Some(assignees) = &self.assignees { format!("{:?}", assignees) } else { String::new() }, format!("{:?}", self.milestone), format!("{:?}", self.locked), if let Some(active_lock_reason) = &self.active_lock_reason { format!("{:?}", active_lock_reason) } else { String::new() }, format!("{:?}", self.comments), if let Some(pull_request) = &self.pull_request { format!("{:?}", pull_request) } else { String::new() }, format!("{:?}", self.closed_at), format!("{:?}", self.created_at), format!("{:?}", self.updated_at), if let Some(draft) = &self.draft { format!("{:?}", draft) } else { String::new() }, if let Some(closed_by) = &self.closed_by { format!("{:?}", closed_by) } else { String::new() }, if let Some(body_html) = &self.body_html { format!("{:?}", body_html) } else { String::new() }, if let Some(body_text) = &self.body_text { format!("{:?}", body_text) } else { String::new() }, if let Some(timeline_url) = &self.timeline_url { format!("{:?}", timeline_url) } else { String::new() }, if let Some(repository) = &self.repository { format!("{:?}", repository) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, format!("{:?}", self.author_association), if let Some(reactions) = &self.reactions { format!("{:?}", reactions) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "repository_url".to_string(), "labels_url".to_string(), "comments_url".to_string(), "events_url".to_string(), "html_url".to_string(), "number".to_string(), "state".to_string(), "state_reason".to_string(), "title".to_string(), "body".to_string(), "user".to_string(), "labels".to_string(), "assignee".to_string(), "assignees".to_string(), "milestone".to_string(), "locked".to_string(), "active_lock_reason".to_string(), "comments".to_string(), "pull_request".to_string(), "closed_at".to_string(), "created_at".to_string(), "updated_at".to_string(), "draft".to_string(), "closed_by".to_string(), "body_html".to_string(), "body_text".to_string(), "timeline_url".to_string(), "repository".to_string(), "performed_via_github_app".to_string(), "author_association".to_string(), "reactions".to_string(), ] } } #[doc = "Issue Event Label"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventLabel { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub color: Option, } impl std::fmt::Display for IssueEventLabel { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEventLabel { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![format!("{:?}", self.name), format!("{:?}", self.color)] } fn headers() -> Vec { vec!["name".to_string(), "color".to_string()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventDismissedReview { pub state: String, pub review_id: i64, #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissal_message: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissal_commit_id: Option, } impl std::fmt::Display for IssueEventDismissedReview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEventDismissedReview { const LENGTH: usize = 4; fn fields(&self) -> Vec { vec![ self.state.clone(), format!("{:?}", self.review_id), format!("{:?}", self.dismissal_message), if let Some(dismissal_commit_id) = &self.dismissal_commit_id { format!("{:?}", dismissal_commit_id) } else { String::new() }, ] } fn headers() -> Vec { vec![ "state".to_string(), "review_id".to_string(), "dismissal_message".to_string(), "dismissal_commit_id".to_string(), ] } } #[doc = "Issue Event Milestone"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventMilestone { pub title: String, } impl std::fmt::Display for IssueEventMilestone { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEventMilestone { const LENGTH: usize = 1; fn fields(&self) -> Vec { vec![self.title.clone()] } fn headers() -> Vec { vec!["title".to_string()] } } #[doc = "Issue Event Project Card"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventProjectCard { pub url: url::Url, pub id: i64, pub project_url: url::Url, pub project_id: i64, pub column_name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub previous_column_name: Option, } impl std::fmt::Display for IssueEventProjectCard { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEventProjectCard { const LENGTH: usize = 6; fn fields(&self) -> Vec { vec![ format!("{:?}", self.url), format!("{:?}", self.id), format!("{:?}", self.project_url), format!("{:?}", self.project_id), self.column_name.clone(), if let Some(previous_column_name) = &self.previous_column_name { format!("{:?}", previous_column_name) } else { String::new() }, ] } fn headers() -> Vec { vec![ "url".to_string(), "id".to_string(), "project_url".to_string(), "project_id".to_string(), "column_name".to_string(), "previous_column_name".to_string(), ] } } #[doc = "Issue Event Rename"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventRename { pub from: String, pub to: String, } impl std::fmt::Display for IssueEventRename { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEventRename { const LENGTH: usize = 2; fn fields(&self) -> Vec { vec![self.from.clone(), self.to.clone()] } fn headers() -> Vec { vec!["from".to_string(), "to".to_string()] } } #[doc = "Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEvent { pub id: i64, pub node_id: String, pub url: url::Url, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub actor: Option, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: chrono::DateTime, #[doc = "Issues are a great way to keep track of tasks, enhancements, and bugs for your projects."] #[serde(default, skip_serializing_if = "Option::is_none")] pub issue: Option, #[doc = "Issue Event Label"] #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub assigner: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub review_requester: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_reviewer: Option, #[doc = "Groups of organization members that gives permissions on specified repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_team: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub dismissed_review: Option, #[doc = "Issue Event Milestone"] #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, #[doc = "Issue Event Project Card"] #[serde(default, skip_serializing_if = "Option::is_none")] pub project_card: Option, #[doc = "Issue Event Rename"] #[serde(default, skip_serializing_if = "Option::is_none")] pub rename: Option, #[doc = "How the author is associated with the repository."] #[serde(default, skip_serializing_if = "Option::is_none")] pub author_association: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub lock_reason: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, } impl std::fmt::Display for IssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for IssueEvent { const LENGTH: usize = 22; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), format!("{:?}", self.url), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), format!("{:?}", self.created_at), if let Some(issue) = &self.issue { format!("{:?}", issue) } else { String::new() }, if let Some(label) = &self.label { format!("{:?}", label) } else { String::new() }, if let Some(assignee) = &self.assignee { format!("{:?}", assignee) } else { String::new() }, if let Some(assigner) = &self.assigner { format!("{:?}", assigner) } else { String::new() }, if let Some(review_requester) = &self.review_requester { format!("{:?}", review_requester) } else { String::new() }, if let Some(requested_reviewer) = &self.requested_reviewer { format!("{:?}", requested_reviewer) } else { String::new() }, if let Some(requested_team) = &self.requested_team { format!("{:?}", requested_team) } else { String::new() }, if let Some(dismissed_review) = &self.dismissed_review { format!("{:?}", dismissed_review) } else { String::new() }, if let Some(milestone) = &self.milestone { format!("{:?}", milestone) } else { String::new() }, if let Some(project_card) = &self.project_card { format!("{:?}", project_card) } else { String::new() }, if let Some(rename) = &self.rename { format!("{:?}", rename) } else { String::new() }, if let Some(author_association) = &self.author_association { format!("{:?}", author_association) } else { String::new() }, if let Some(lock_reason) = &self.lock_reason { format!("{:?}", lock_reason) } else { String::new() }, if let Some(performed_via_github_app) = &self.performed_via_github_app { format!("{:?}", performed_via_github_app) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "issue".to_string(), "label".to_string(), "assignee".to_string(), "assigner".to_string(), "review_requester".to_string(), "requested_reviewer".to_string(), "requested_team".to_string(), "dismissed_review".to_string(), "milestone".to_string(), "project_card".to_string(), "rename".to_string(), "author_association".to_string(), "lock_reason".to_string(), "performed_via_github_app".to_string(), ] } } #[doc = "Labeled Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct LabeledIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub label: Label, } impl std::fmt::Display for LabeledIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for LabeledIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.label), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "label".to_string(), ] } } #[doc = "Unlabeled Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct UnlabeledIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub label: Label, } impl std::fmt::Display for UnlabeledIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for UnlabeledIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.label), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "label".to_string(), ] } } #[doc = "Assigned Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AssignedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] pub performed_via_github_app: Integration, #[doc = "Simple User"] pub assignee: SimpleUser, #[doc = "Simple User"] pub assigner: SimpleUser, } impl std::fmt::Display for AssignedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AssignedIssueEvent { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.assignee), format!("{:?}", self.assigner), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "assignee".to_string(), "assigner".to_string(), ] } } #[doc = "Unassigned Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct UnassignedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[doc = "Simple User"] pub assignee: SimpleUser, #[doc = "Simple User"] pub assigner: SimpleUser, } impl std::fmt::Display for UnassignedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for UnassignedIssueEvent { const LENGTH: usize = 11; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.assignee), format!("{:?}", self.assigner), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "assignee".to_string(), "assigner".to_string(), ] } } #[doc = "Milestoned Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct MilestonedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub milestone: Milestone, } impl std::fmt::Display for MilestonedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for MilestonedIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.milestone), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "milestone".to_string(), ] } } #[doc = "Demilestoned Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct DemilestonedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub milestone: Milestone, } impl std::fmt::Display for DemilestonedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for DemilestonedIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.milestone), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "milestone".to_string(), ] } } #[doc = "Renamed Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RenamedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub rename: Rename, } impl std::fmt::Display for RenamedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RenamedIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.rename), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "rename".to_string(), ] } } #[doc = "Review Requested Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ReviewRequestedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[doc = "Simple User"] pub review_requester: SimpleUser, #[doc = "Groups of organization members that gives permissions on specified repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_team: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_reviewer: Option, } impl std::fmt::Display for ReviewRequestedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ReviewRequestedIssueEvent { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.review_requester), if let Some(requested_team) = &self.requested_team { format!("{:?}", requested_team) } else { String::new() }, if let Some(requested_reviewer) = &self.requested_reviewer { format!("{:?}", requested_reviewer) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "review_requester".to_string(), "requested_team".to_string(), "requested_reviewer".to_string(), ] } } #[doc = "Review Request Removed Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ReviewRequestRemovedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[doc = "Simple User"] pub review_requester: SimpleUser, #[doc = "Groups of organization members that gives permissions on specified repositories."] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_team: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub requested_reviewer: Option, } impl std::fmt::Display for ReviewRequestRemovedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ReviewRequestRemovedIssueEvent { const LENGTH: usize = 12; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.review_requester), if let Some(requested_team) = &self.requested_team { format!("{:?}", requested_team) } else { String::new() }, if let Some(requested_reviewer) = &self.requested_reviewer { format!("{:?}", requested_reviewer) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "review_requester".to_string(), "requested_team".to_string(), "requested_reviewer".to_string(), ] } } #[doc = "Review Dismissed Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ReviewDismissedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, pub dismissed_review: DismissedReview, } impl std::fmt::Display for ReviewDismissedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ReviewDismissedIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.dismissed_review), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "dismissed_review".to_string(), ] } } #[doc = "Locked Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct LockedIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub lock_reason: Option, } impl std::fmt::Display for LockedIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for LockedIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), format!("{:?}", self.lock_reason), ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "lock_reason".to_string(), ] } } #[doc = "Added to Project Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct AddedToProjectIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_card: Option, } impl std::fmt::Display for AddedToProjectIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for AddedToProjectIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), if let Some(project_card) = &self.project_card { format!("{:?}", project_card) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "project_card".to_string(), ] } } #[doc = "Moved Column in Project Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct MovedColumnInProjectIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_card: Option, } impl std::fmt::Display for MovedColumnInProjectIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for MovedColumnInProjectIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), if let Some(project_card) = &self.project_card { format!("{:?}", project_card) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "project_card".to_string(), ] } } #[doc = "Removed from Project Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct RemovedFromProjectIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_card: Option, } impl std::fmt::Display for RemovedFromProjectIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for RemovedFromProjectIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), if let Some(project_card) = &self.project_card { format!("{:?}", project_card) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "project_card".to_string(), ] } } #[doc = "Converted Note to Issue Issue Event"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct ConvertedNoteToIssueIssueEvent { pub id: i64, pub node_id: String, pub url: String, #[doc = "Simple User"] pub actor: SimpleUser, pub event: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, pub created_at: String, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] pub performed_via_github_app: Integration, #[serde(default, skip_serializing_if = "Option::is_none")] pub project_card: Option, } impl std::fmt::Display for ConvertedNoteToIssueIssueEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, "{}", serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? ) } } impl tabled::Tabled for ConvertedNoteToIssueIssueEvent { const LENGTH: usize = 10; fn fields(&self) -> Vec { vec![ format!("{:?}", self.id), self.node_id.clone(), self.url.clone(), format!("{:?}", self.actor), self.event.clone(), format!("{:?}", self.commit_id), format!("{:?}", self.commit_url), self.created_at.clone(), format!("{:?}", self.performed_via_github_app), if let Some(project_card) = &self.project_card { format!("{:?}", project_card) } else { String::new() }, ] } fn headers() -> Vec { vec![ "id".to_string(), "node_id".to_string(), "url".to_string(), "actor".to_string(), "event".to_string(), "commit_id".to_string(), "commit_url".to_string(), "created_at".to_string(), "performed_via_github_app".to_string(), "project_card".to_string(), ] } } #[doc = "Issue Event for Issue"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] pub struct IssueEventForIssue { #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub node_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, #[doc = "Simple User"] #[serde(default, skip_serializing_if = "Option::is_none")] pub actor: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub event: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub commit_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub created_at: Option, #[doc = "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub."] #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub label: Option