openapi_github/models/
apps_scope_token_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AppsScopeTokenRequest {
16    /// The access token used to authenticate to the GitHub API.
17    #[serde(rename = "access_token")]
18    pub access_token: String,
19    /// The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified.
20    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
21    pub target: Option<String>,
22    /// The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified.
23    #[serde(rename = "target_id", skip_serializing_if = "Option::is_none")]
24    pub target_id: Option<i32>,
25    /// The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified.
26    #[serde(rename = "repositories", skip_serializing_if = "Option::is_none")]
27    pub repositories: Option<Vec<String>>,
28    /// The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified.
29    #[serde(rename = "repository_ids", skip_serializing_if = "Option::is_none")]
30    pub repository_ids: Option<Vec<i32>>,
31    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
32    pub permissions: Option<Box<models::AppPermissions>>,
33}
34
35impl AppsScopeTokenRequest {
36    pub fn new(access_token: String) -> AppsScopeTokenRequest {
37        AppsScopeTokenRequest {
38            access_token,
39            target: None,
40            target_id: None,
41            repositories: None,
42            repository_ids: None,
43            permissions: None,
44        }
45    }
46}
47