openapi_github/models/repos_update_branch_protection_request_restrictions.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/// ReposUpdateBranchProtectionRequestRestrictions : Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ReposUpdateBranchProtectionRequestRestrictions {
17 /// The list of user `login`s with push access
18 #[serde(rename = "users")]
19 pub users: Vec<String>,
20 /// The list of team `slug`s with push access
21 #[serde(rename = "teams")]
22 pub teams: Vec<String>,
23 /// The list of app `slug`s with push access
24 #[serde(rename = "apps", skip_serializing_if = "Option::is_none")]
25 pub apps: Option<Vec<String>>,
26}
27
28impl ReposUpdateBranchProtectionRequestRestrictions {
29 /// Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable.
30 pub fn new(users: Vec<String>, teams: Vec<String>) -> ReposUpdateBranchProtectionRequestRestrictions {
31 ReposUpdateBranchProtectionRequestRestrictions {
32 users,
33 teams,
34 apps: None,
35 }
36 }
37}
38