openapi_github/models/
autolink.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/// Autolink : An autolink reference.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Autolink {
17    #[serde(rename = "id")]
18    pub id: i32,
19    /// The prefix of a key that is linkified.
20    #[serde(rename = "key_prefix")]
21    pub key_prefix: String,
22    /// A template for the target URL that is generated if a key was found.
23    #[serde(rename = "url_template")]
24    pub url_template: String,
25    /// Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters.
26    #[serde(rename = "is_alphanumeric")]
27    pub is_alphanumeric: bool,
28}
29
30impl Autolink {
31    /// An autolink reference.
32    pub fn new(id: i32, key_prefix: String, url_template: String, is_alphanumeric: bool) -> Autolink {
33        Autolink {
34            id,
35            key_prefix,
36            url_template,
37            is_alphanumeric,
38        }
39    }
40}
41