openapi_github/models/
actor.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/// Actor : Actor
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Actor {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "login")]
20    pub login: String,
21    #[serde(rename = "display_login", skip_serializing_if = "Option::is_none")]
22    pub display_login: Option<String>,
23    #[serde(rename = "gravatar_id", deserialize_with = "Option::deserialize")]
24    pub gravatar_id: Option<String>,
25    #[serde(rename = "url")]
26    pub url: String,
27    #[serde(rename = "avatar_url")]
28    pub avatar_url: String,
29}
30
31impl Actor {
32    /// Actor
33    pub fn new(id: i32, login: String, gravatar_id: Option<String>, url: String, avatar_url: String) -> Actor {
34        Actor {
35            id,
36            login,
37            display_login: None,
38            gravatar_id,
39            url,
40            avatar_url,
41        }
42    }
43}
44