openapi_github/models/
blob.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Blob : Blob
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Blob {
17    #[serde(rename = "content")]
18    pub content: String,
19    #[serde(rename = "encoding")]
20    pub encoding: String,
21    #[serde(rename = "url")]
22    pub url: String,
23    #[serde(rename = "sha")]
24    pub sha: String,
25    #[serde(rename = "size", deserialize_with = "Option::deserialize")]
26    pub size: Option<i32>,
27    #[serde(rename = "node_id")]
28    pub node_id: String,
29    #[serde(rename = "highlighted_content", skip_serializing_if = "Option::is_none")]
30    pub highlighted_content: Option<String>,
31}
32
33impl Blob {
34    /// Blob
35    pub fn new(content: String, encoding: String, url: String, sha: String, size: Option<i32>, node_id: String) -> Blob {
36        Blob {
37            content,
38            encoding,
39            url,
40            sha,
41            size,
42            node_id,
43            highlighted_content: None,
44        }
45    }
46}
47