openapi_github/models/repository_rule_params_workflow_file_reference.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/// RepositoryRuleParamsWorkflowFileReference : A workflow that must run for this rule to pass
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryRuleParamsWorkflowFileReference {
17 /// The path to the workflow file
18 #[serde(rename = "path")]
19 pub path: String,
20 /// The ref (branch or tag) of the workflow file to use
21 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
22 pub r#ref: Option<String>,
23 /// The ID of the repository where the workflow is defined
24 #[serde(rename = "repository_id")]
25 pub repository_id: i32,
26 /// The commit SHA of the workflow file to use
27 #[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
28 pub sha: Option<String>,
29}
30
31impl RepositoryRuleParamsWorkflowFileReference {
32 /// A workflow that must run for this rule to pass
33 pub fn new(path: String, repository_id: i32) -> RepositoryRuleParamsWorkflowFileReference {
34 RepositoryRuleParamsWorkflowFileReference {
35 path,
36 r#ref: None,
37 repository_id,
38 sha: None,
39 }
40 }
41}
42