diff --git a/codegen/java/github/RustServerCodegen.java b/codegen/java/github/RustServerCodegen.java index 3692368..212cdf3 100644 --- a/codegen/java/github/RustServerCodegen.java +++ b/codegen/java/github/RustServerCodegen.java @@ -349,6 +349,9 @@ public String apiFileFolder() { public String toModelName(String name) { // camelize the model name // phone_number => PhoneNumber + if (name != null && name.contains("chrono")) { + return name; + } String camelizedName = camelize(toModelFilename(name)); // model name cannot use reserved keyword, e.g. return diff --git a/codegen/templates/api.mustache b/codegen/templates/api.mustache index a5f2a8a..c5f9ab1 100644 --- a/codegen/templates/api.mustache +++ b/codegen/templates/api.mustache @@ -145,7 +145,7 @@ impl<'api, C: Client> {{classname}}<'api, C> where AdapterError: From< {{classname}}<'api, C> where AdapterError: From< Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -4838,7 +4838,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -4882,7 +4882,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsAddSelectedRepoToOrgSecretError::Status409.into()), @@ -4928,7 +4928,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsAddSelectedRepoToOrgSecretError::Status409.into()), @@ -4972,7 +4972,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsAddSelectedRepoToOrgVariableError::Status409.into()), @@ -5017,7 +5017,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsAddSelectedRepoToOrgVariableError::Status409.into()), @@ -5058,7 +5058,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsAddSelfHostedRunnerToGroupForOrgError::Generic { code }.into()), @@ -5099,7 +5099,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsAddSelfHostedRunnerToGroupForOrgError::Generic { code }.into()), @@ -6300,7 +6300,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsCreateWorkflowDispatchError::Generic { code }.into()), @@ -6343,7 +6343,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsCreateWorkflowDispatchError::Generic { code }.into()), @@ -6383,7 +6383,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteActionsCacheByIdError::Generic { code }.into()), @@ -6424,7 +6424,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteActionsCacheByIdError::Generic { code }.into()), @@ -6549,7 +6549,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteArtifactError::Generic { code }.into()), @@ -6589,7 +6589,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteArtifactError::Generic { code }.into()), @@ -6631,7 +6631,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteEnvironmentSecretError::Generic { code }.into()), @@ -6674,7 +6674,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteEnvironmentSecretError::Generic { code }.into()), @@ -6716,7 +6716,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteEnvironmentVariableError::Generic { code }.into()), @@ -6759,7 +6759,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteEnvironmentVariableError::Generic { code }.into()), @@ -6801,7 +6801,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteOrgSecretError::Generic { code }.into()), @@ -6844,7 +6844,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteOrgSecretError::Generic { code }.into()), @@ -6886,7 +6886,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteOrgVariableError::Generic { code }.into()), @@ -6929,7 +6929,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteOrgVariableError::Generic { code }.into()), @@ -6971,7 +6971,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteRepoSecretError::Generic { code }.into()), @@ -7014,7 +7014,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteRepoSecretError::Generic { code }.into()), @@ -7056,7 +7056,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteRepoVariableError::Generic { code }.into()), @@ -7099,7 +7099,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteRepoVariableError::Generic { code }.into()), @@ -7141,7 +7141,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerFromOrgError::Generic { code }.into()), @@ -7184,7 +7184,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerFromOrgError::Generic { code }.into()), @@ -7226,7 +7226,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerFromRepoError::Generic { code }.into()), @@ -7269,7 +7269,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerFromRepoError::Generic { code }.into()), @@ -7309,7 +7309,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerGroupFromOrgError::Generic { code }.into()), @@ -7350,7 +7350,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteSelfHostedRunnerGroupFromOrgError::Generic { code }.into()), @@ -7392,7 +7392,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteWorkflowRunError::Generic { code }.into()), @@ -7435,7 +7435,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDeleteWorkflowRunError::Generic { code }.into()), @@ -7475,7 +7475,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ActionsDeleteWorkflowRunLogsError::Status403(github_response.to_json_async().await?).into()), @@ -7518,7 +7518,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ActionsDeleteWorkflowRunLogsError::Status403(github_response.to_json()?).into()), @@ -7560,7 +7560,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDisableSelectedRepositoryGithubActionsOrganizationError::Generic { code }.into()), @@ -7601,7 +7601,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDisableSelectedRepositoryGithubActionsOrganizationError::Generic { code }.into()), @@ -7641,7 +7641,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDisableWorkflowError::Generic { code }.into()), @@ -7682,7 +7682,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsDisableWorkflowError::Generic { code }.into()), @@ -7723,7 +7723,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadArtifactError::Status302.into()), @@ -7767,7 +7767,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadArtifactError::Status302.into()), @@ -7812,7 +7812,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadJobLogsForWorkflowRunError::Status302.into()), @@ -7857,7 +7857,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadJobLogsForWorkflowRunError::Status302.into()), @@ -7901,7 +7901,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadWorkflowRunAttemptLogsError::Status302.into()), @@ -7946,7 +7946,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadWorkflowRunAttemptLogsError::Status302.into()), @@ -7990,7 +7990,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadWorkflowRunLogsError::Status302.into()), @@ -8035,7 +8035,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ActionsDownloadWorkflowRunLogsError::Status302.into()), @@ -8076,7 +8076,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsEnableSelectedRepositoryGithubActionsOrganizationError::Generic { code }.into()), @@ -8117,7 +8117,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsEnableSelectedRepositoryGithubActionsOrganizationError::Generic { code }.into()), @@ -8157,7 +8157,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsEnableWorkflowError::Generic { code }.into()), @@ -8198,7 +8198,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsEnableWorkflowError::Generic { code }.into()), @@ -14455,7 +14455,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -14496,7 +14496,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -14540,7 +14540,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsRemoveSelectedRepoFromOrgSecretError::Status409.into()), @@ -14586,7 +14586,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsRemoveSelectedRepoFromOrgSecretError::Status409.into()), @@ -14631,7 +14631,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsRemoveSelectedRepoFromOrgVariableError::Status409.into()), @@ -14677,7 +14677,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsRemoveSelectedRepoFromOrgVariableError::Status409.into()), @@ -14718,7 +14718,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsRemoveSelfHostedRunnerFromGroupForOrgError::Generic { code }.into()), @@ -14759,7 +14759,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsRemoveSelfHostedRunnerFromGroupForOrgError::Generic { code }.into()), @@ -14802,7 +14802,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsReviewCustomGatesForRunError::Generic { code }.into()), @@ -14846,7 +14846,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsReviewCustomGatesForRunError::Generic { code }.into()), @@ -14971,7 +14971,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetAllowedActionsOrganizationError::Generic { code }.into()), @@ -15012,7 +15012,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetAllowedActionsOrganizationError::Generic { code }.into()), @@ -15052,7 +15052,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetAllowedActionsRepositoryError::Generic { code }.into()), @@ -15093,7 +15093,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetAllowedActionsRepositoryError::Generic { code }.into()), @@ -15404,7 +15404,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationError::Generic { code }.into()), @@ -15447,7 +15447,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationError::Generic { code }.into()), @@ -15489,7 +15489,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryError::Status409.into()), @@ -15533,7 +15533,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryError::Status409.into()), @@ -15574,7 +15574,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsPermissionsOrganizationError::Generic { code }.into()), @@ -15615,7 +15615,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsPermissionsOrganizationError::Generic { code }.into()), @@ -15655,7 +15655,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsPermissionsRepositoryError::Generic { code }.into()), @@ -15696,7 +15696,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetGithubActionsPermissionsRepositoryError::Generic { code }.into()), @@ -15736,7 +15736,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -15777,7 +15777,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError::Generic { code }.into()), @@ -15821,7 +15821,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelectedReposForOrgSecretError::Generic { code }.into()), @@ -15866,7 +15866,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelectedReposForOrgSecretError::Generic { code }.into()), @@ -15910,7 +15910,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsSetSelectedReposForOrgVariableError::Status409.into()), @@ -15956,7 +15956,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ActionsSetSelectedReposForOrgVariableError::Status409.into()), @@ -15998,7 +15998,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError::Generic { code }.into()), @@ -16040,7 +16040,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError::Generic { code }.into()), @@ -16080,7 +16080,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelfHostedRunnersInGroupForOrgError::Generic { code }.into()), @@ -16121,7 +16121,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetSelfHostedRunnersInGroupForOrgError::Generic { code }.into()), @@ -16163,7 +16163,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetWorkflowAccessToRepositoryError::Generic { code }.into()), @@ -16206,7 +16206,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsSetWorkflowAccessToRepositoryError::Generic { code }.into()), @@ -16248,7 +16248,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateEnvironmentVariableError::Generic { code }.into()), @@ -16291,7 +16291,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateEnvironmentVariableError::Generic { code }.into()), @@ -16333,7 +16333,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateOrgVariableError::Generic { code }.into()), @@ -16376,7 +16376,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateOrgVariableError::Generic { code }.into()), @@ -16418,7 +16418,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateRepoVariableError::Generic { code }.into()), @@ -16461,7 +16461,7 @@ impl<'api, C: Client> Actions<'api, C> where AdapterError: From<::E // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActionsUpdateRepoVariableError::Generic { code }.into()), diff --git a/src/endpoints/activity.rs b/src/endpoints/activity.rs index 5a274f0..24dd4f0 100644 --- a/src/endpoints/activity.rs +++ b/src/endpoints/activity.rs @@ -1752,7 +1752,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ActivityCheckRepoIsStarredByAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -1795,7 +1795,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ActivityCheckRepoIsStarredByAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -1837,7 +1837,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActivityDeleteRepoSubscriptionError::Generic { code }.into()), @@ -1876,7 +1876,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActivityDeleteRepoSubscriptionError::Generic { code }.into()), @@ -1914,7 +1914,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ActivityDeleteThreadSubscriptionError::Status304.into()), @@ -1956,7 +1956,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ActivityDeleteThreadSubscriptionError::Status304.into()), @@ -2325,7 +2325,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: /// /// # List events for the authenticated user /// - /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. @@ -2370,7 +2370,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: /// /// # List events for the authenticated user /// - /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. @@ -4069,7 +4069,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ActivityMarkThreadAsDoneError::Generic { code }.into()), @@ -4108,7 +4108,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ActivityMarkThreadAsDoneError::Generic { code }.into()), @@ -4146,7 +4146,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ActivityMarkThreadAsReadError::Status304.into()), @@ -4187,7 +4187,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ActivityMarkThreadAsReadError::Status304.into()), @@ -4395,7 +4395,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ActivityStarRepoForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), @@ -4438,7 +4438,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ActivityStarRepoForAuthenticatedUserError::Status403(github_response.to_json()?).into()), @@ -4480,7 +4480,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ActivityUnstarRepoForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -4523,7 +4523,7 @@ impl<'api, C: Client> Activity<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ActivityUnstarRepoForAuthenticatedUserError::Status404(github_response.to_json()?).into()), diff --git a/src/endpoints/apps.rs b/src/endpoints/apps.rs index 4794dda..339468b 100644 --- a/src/endpoints/apps.rs +++ b/src/endpoints/apps.rs @@ -1527,9 +1527,7 @@ pub struct AppsListWebhookDeliveriesParams<'req> { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - cursor: Option<&'req str>, - - redelivery: Option + cursor: Option<&'req str> } impl<'req> AppsListWebhookDeliveriesParams<'req> { @@ -1542,7 +1540,6 @@ impl<'req> AppsListWebhookDeliveriesParams<'req> { Self { per_page: Some(per_page), cursor: self.cursor, - redelivery: self.redelivery, } } @@ -1551,16 +1548,6 @@ impl<'req> AppsListWebhookDeliveriesParams<'req> { Self { per_page: self.per_page, cursor: Some(cursor), - redelivery: self.redelivery, - } - } - - - pub fn redelivery(self, redelivery: bool) -> Self { - Self { - per_page: self.per_page, - cursor: self.cursor, - redelivery: Some(redelivery), } } } @@ -1599,7 +1586,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(AppsAddRepoToInstallationForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), @@ -1643,7 +1630,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(AppsAddRepoToInstallationForAuthenticatedUserError::Status403(github_response.to_json()?).into()), @@ -1948,7 +1935,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(AppsDeleteAuthorizationError::Status422(github_response.to_json_async().await?).into()), @@ -1989,7 +1976,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(AppsDeleteAuthorizationError::Status422(github_response.to_json()?).into()), @@ -2030,7 +2017,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsDeleteInstallationError::Status404(github_response.to_json_async().await?).into()), @@ -2072,7 +2059,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsDeleteInstallationError::Status404(github_response.to_json()?).into()), @@ -2111,7 +2098,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(AppsDeleteTokenError::Status422(github_response.to_json_async().await?).into()), @@ -2151,7 +2138,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(AppsDeleteTokenError::Status422(github_response.to_json()?).into()), @@ -4229,7 +4216,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(AppsRemoveRepoFromInstallationForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), @@ -4274,7 +4261,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(AppsRemoveRepoFromInstallationForAuthenticatedUserError::Status403(github_response.to_json()?).into()), @@ -4397,7 +4384,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(AppsRevokeInstallationAccessTokenError::Generic { code }.into()), @@ -4438,7 +4425,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(AppsRevokeInstallationAccessTokenError::Generic { code }.into()), @@ -4571,7 +4558,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsSuspendInstallationError::Status404(github_response.to_json_async().await?).into()), @@ -4613,7 +4600,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsSuspendInstallationError::Status404(github_response.to_json()?).into()), @@ -4654,7 +4641,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsUnsuspendInstallationError::Status404(github_response.to_json_async().await?).into()), @@ -4696,7 +4683,7 @@ impl<'api, C: Client> Apps<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(AppsUnsuspendInstallationError::Status404(github_response.to_json()?).into()), diff --git a/src/endpoints/code_scanning.rs b/src/endpoints/code_scanning.rs index ef1f0ae..1b9f779 100644 --- a/src/endpoints/code_scanning.rs +++ b/src/endpoints/code_scanning.rs @@ -93,6 +93,36 @@ impl From for AdapterError { } } +/// Errors for the [Delete a CodeQL database](CodeScanning::delete_codeql_database_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum CodeScanningDeleteCodeqlDatabaseError { + #[error("Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository")] + Status403(BasicError), + #[error("Resource not found")] + Status404(BasicError), + #[error("Service unavailable")] + Status503(PostCodespacesCreateForAuthenticatedUserResponse503), + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: CodeScanningDeleteCodeqlDatabaseError) -> Self { + let (description, status_code) = match err { + CodeScanningDeleteCodeqlDatabaseError::Status403(_) => (String::from("Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository"), 403), + CodeScanningDeleteCodeqlDatabaseError::Status404(_) => (String::from("Resource not found"), 404), + CodeScanningDeleteCodeqlDatabaseError::Status503(_) => (String::from("Service unavailable"), 503), + CodeScanningDeleteCodeqlDatabaseError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + /// Errors for the [Get a code scanning alert](CodeScanning::get_alert_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum CodeScanningGetAlertError { @@ -1596,6 +1626,93 @@ impl<'api, C: Client> CodeScanning<'api, C> where AdapterError: From< Result<(), AdapterError> { + + let request_uri = format!("{}/repos/{}/{}/code-scanning/codeql/databases/{}", super::GITHUB_BASE_API_URL, owner, repo, language); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 403 => Err(CodeScanningDeleteCodeqlDatabaseError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CodeScanningDeleteCodeqlDatabaseError::Status404(github_response.to_json_async().await?).into()), + 503 => Err(CodeScanningDeleteCodeqlDatabaseError::Status503(github_response.to_json_async().await?).into()), + code => Err(CodeScanningDeleteCodeqlDatabaseError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// [GitHub API docs for delete_codeql_database](https://docs.github.com/rest/code-scanning/code-scanning#delete-a-codeql-database) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn delete_codeql_database(&self, owner: &str, repo: &str, language: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/repos/{}/{}/code-scanning/codeql/databases/{}", super::GITHUB_BASE_API_URL, owner, repo, language); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 403 => Err(CodeScanningDeleteCodeqlDatabaseError::Status403(github_response.to_json()?).into()), + 404 => Err(CodeScanningDeleteCodeqlDatabaseError::Status404(github_response.to_json()?).into()), + 503 => Err(CodeScanningDeleteCodeqlDatabaseError::Status503(github_response.to_json()?).into()), + code => Err(CodeScanningDeleteCodeqlDatabaseError::Generic { code }.into()), + } + } + } + /// --- /// /// # Get a code scanning alert @@ -1812,7 +1929,7 @@ impl<'api, C: Client> CodeScanning<'api, C> where AdapterError: From< CodeScanning<'api, C> where AdapterError: From< CodeScanning<'api, C> where AdapterError: From< CodeScanning<'api, C> where AdapterError: From< CodeScanning<'api, C> where AdapterError: From< [!WARNING] - /// > **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + /// > **Closing down notice:** The `tool_name` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// @@ -2705,7 +2822,7 @@ impl<'api, C: Client> CodeScanning<'api, C> where AdapterError: From< [!WARNING] - /// > **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + /// > **Closing down notice:** The `tool_name` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// diff --git a/src/endpoints/code_security.rs b/src/endpoints/code_security.rs index 6a1cc66..f2117fc 100644 --- a/src/endpoints/code_security.rs +++ b/src/endpoints/code_security.rs @@ -667,7 +667,7 @@ impl<'api, C: Client> CodeSecurity<'api, C> where AdapterError: From< Err(CodeSecurityDeleteConfigurationError::Status400(github_response.to_json_async().await?).into()), @@ -716,7 +716,7 @@ impl<'api, C: Client> CodeSecurity<'api, C> where AdapterError: From< Err(CodeSecurityDeleteConfigurationError::Status400(github_response.to_json()?).into()), @@ -763,7 +763,7 @@ impl<'api, C: Client> CodeSecurity<'api, C> where AdapterError: From< Err(CodeSecurityDetachConfigurationError::Status400(github_response.to_json_async().await?).into()), @@ -811,7 +811,7 @@ impl<'api, C: Client> CodeSecurity<'api, C> where AdapterError: From< Err(CodeSecurityDetachConfigurationError::Status400(github_response.to_json()?).into()), diff --git a/src/endpoints/codespaces.rs b/src/endpoints/codespaces.rs index afb097c..471579b 100644 --- a/src/endpoints/codespaces.rs +++ b/src/endpoints/codespaces.rs @@ -2007,7 +2007,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesAddRepositoryForSecretForAuthenticatedUserError::Status401(github_response.to_json_async().await?).into()), @@ -2054,7 +2054,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesAddRepositoryForSecretForAuthenticatedUserError::Status401(github_response.to_json()?).into()), @@ -2097,7 +2097,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesAddSelectedRepoToOrgSecretError::Status404(github_response.to_json_async().await?).into()), @@ -2140,7 +2140,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesAddSelectedRepoToOrgSecretError::Status404(github_response.to_json()?).into()), @@ -2919,7 +2919,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesDeleteCodespacesAccessUsersError::Status304.into()), @@ -2968,7 +2968,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesDeleteCodespacesAccessUsersError::Status304.into()), @@ -3195,7 +3195,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesDeleteOrgSecretError::Status404(github_response.to_json_async().await?).into()), @@ -3237,7 +3237,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesDeleteOrgSecretError::Status404(github_response.to_json()?).into()), @@ -3278,7 +3278,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(CodespacesDeleteRepoSecretError::Generic { code }.into()), @@ -3319,7 +3319,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(CodespacesDeleteRepoSecretError::Generic { code }.into()), @@ -3361,7 +3361,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(CodespacesDeleteSecretForAuthenticatedUserError::Generic { code }.into()), @@ -3404,7 +3404,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(CodespacesDeleteSecretForAuthenticatedUserError::Generic { code }.into()), @@ -5369,7 +5369,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesRemoveRepositoryForSecretForAuthenticatedUserError::Status401(github_response.to_json_async().await?).into()), @@ -5416,7 +5416,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesRemoveRepositoryForSecretForAuthenticatedUserError::Status401(github_response.to_json()?).into()), @@ -5462,7 +5462,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesRemoveSelectedRepoFromOrgSecretError::Status404(github_response.to_json_async().await?).into()), @@ -5508,7 +5508,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesRemoveSelectedRepoFromOrgSecretError::Status404(github_response.to_json()?).into()), @@ -5650,7 +5650,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesSetCodespacesAccessError::Status304.into()), @@ -5695,7 +5695,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesSetCodespacesAccessError::Status304.into()), @@ -5743,7 +5743,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesSetCodespacesAccessUsersError::Status304.into()), @@ -5792,7 +5792,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(CodespacesSetCodespacesAccessUsersError::Status304.into()), @@ -5839,7 +5839,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesSetRepositoriesForSecretForAuthenticatedUserError::Status401(github_response.to_json_async().await?).into()), @@ -5886,7 +5886,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 401 => Err(CodespacesSetRepositoriesForSecretForAuthenticatedUserError::Status401(github_response.to_json()?).into()), @@ -5932,7 +5932,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesSetSelectedReposForOrgSecretError::Status404(github_response.to_json_async().await?).into()), @@ -5977,7 +5977,7 @@ impl<'api, C: Client> Codespaces<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(CodespacesSetSelectedReposForOrgSecretError::Status404(github_response.to_json()?).into()), diff --git a/src/endpoints/copilot.rs b/src/endpoints/copilot.rs index af0bb27..eaebbdc 100644 --- a/src/endpoints/copilot.rs +++ b/src/endpoints/copilot.rs @@ -174,6 +174,138 @@ impl From for AdapterError { } } +/// Errors for the [Get Copilot metrics for an enterprise](Copilot::copilot_metrics_for_enterprise_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum CopilotCopilotMetricsForEnterpriseError { + #[error("Internal Error")] + Status500(BasicError), + #[error("Forbidden")] + Status403(BasicError), + #[error("Resource not found")] + Status404(BasicError), + #[error("Copilot Usage Merics API setting is disabled at the organization or enterprise level.")] + Status422(BasicError), + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: CopilotCopilotMetricsForEnterpriseError) -> Self { + let (description, status_code) = match err { + CopilotCopilotMetricsForEnterpriseError::Status500(_) => (String::from("Internal Error"), 500), + CopilotCopilotMetricsForEnterpriseError::Status403(_) => (String::from("Forbidden"), 403), + CopilotCopilotMetricsForEnterpriseError::Status404(_) => (String::from("Resource not found"), 404), + CopilotCopilotMetricsForEnterpriseError::Status422(_) => (String::from("Copilot Usage Merics API setting is disabled at the organization or enterprise level."), 422), + CopilotCopilotMetricsForEnterpriseError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get Copilot metrics for an enterprise team](Copilot::copilot_metrics_for_enterprise_team_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum CopilotCopilotMetricsForEnterpriseTeamError { + #[error("Internal Error")] + Status500(BasicError), + #[error("Forbidden")] + Status403(BasicError), + #[error("Resource not found")] + Status404(BasicError), + #[error("Copilot Usage Merics API setting is disabled at the organization or enterprise level.")] + Status422(BasicError), + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: CopilotCopilotMetricsForEnterpriseTeamError) -> Self { + let (description, status_code) = match err { + CopilotCopilotMetricsForEnterpriseTeamError::Status500(_) => (String::from("Internal Error"), 500), + CopilotCopilotMetricsForEnterpriseTeamError::Status403(_) => (String::from("Forbidden"), 403), + CopilotCopilotMetricsForEnterpriseTeamError::Status404(_) => (String::from("Resource not found"), 404), + CopilotCopilotMetricsForEnterpriseTeamError::Status422(_) => (String::from("Copilot Usage Merics API setting is disabled at the organization or enterprise level."), 422), + CopilotCopilotMetricsForEnterpriseTeamError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get Copilot metrics for an organization](Copilot::copilot_metrics_for_organization_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum CopilotCopilotMetricsForOrganizationError { + #[error("Internal Error")] + Status500(BasicError), + #[error("Forbidden")] + Status403(BasicError), + #[error("Resource not found")] + Status404(BasicError), + #[error("Copilot Usage Merics API setting is disabled at the organization or enterprise level.")] + Status422(BasicError), + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: CopilotCopilotMetricsForOrganizationError) -> Self { + let (description, status_code) = match err { + CopilotCopilotMetricsForOrganizationError::Status500(_) => (String::from("Internal Error"), 500), + CopilotCopilotMetricsForOrganizationError::Status403(_) => (String::from("Forbidden"), 403), + CopilotCopilotMetricsForOrganizationError::Status404(_) => (String::from("Resource not found"), 404), + CopilotCopilotMetricsForOrganizationError::Status422(_) => (String::from("Copilot Usage Merics API setting is disabled at the organization or enterprise level."), 422), + CopilotCopilotMetricsForOrganizationError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get Copilot metrics for a team](Copilot::copilot_metrics_for_team_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum CopilotCopilotMetricsForTeamError { + #[error("Internal Error")] + Status500(BasicError), + #[error("Forbidden")] + Status403(BasicError), + #[error("Resource not found")] + Status404(BasicError), + #[error("Copilot Usage Merics API setting is disabled at the organization or enterprise level.")] + Status422(BasicError), + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: CopilotCopilotMetricsForTeamError) -> Self { + let (description, status_code) = match err { + CopilotCopilotMetricsForTeamError::Status500(_) => (String::from("Internal Error"), 500), + CopilotCopilotMetricsForTeamError::Status403(_) => (String::from("Forbidden"), 403), + CopilotCopilotMetricsForTeamError::Status404(_) => (String::from("Resource not found"), 404), + CopilotCopilotMetricsForTeamError::Status422(_) => (String::from("Copilot Usage Merics API setting is disabled at the organization or enterprise level."), 422), + CopilotCopilotMetricsForTeamError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + /// Errors for the [Get Copilot seat information and settings for an organization](Copilot::get_copilot_organization_details_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum CopilotGetCopilotOrganizationDetailsError { @@ -445,38 +577,66 @@ impl From for AdapterError { } -/// Query parameters for the [List all Copilot seat assignments for an organization](Copilot::list_copilot_seats_async()) endpoint. +/// Query parameters for the [Get Copilot metrics for an enterprise](Copilot::copilot_metrics_for_enterprise_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotListCopilotSeatsParams { +pub struct CopilotCopilotMetricsForEnterpriseParams<'req> { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + since: Option<&'req str>, + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + until: Option<&'req str>, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option, - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option } -impl CopilotListCopilotSeatsParams { +impl<'req> CopilotCopilotMetricsForEnterpriseParams<'req> { pub fn new() -> Self { Self::default() } + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + pub fn since(self, since: &'req str) -> Self { + Self { + since: Some(since), + until: self.until, + page: self.page, + per_page: self.per_page, + } + } + + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + pub fn until(self, until: &'req str) -> Self { + Self { + since: self.since, + until: Some(until), + page: self.page, + per_page: self.per_page, + } + } + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { + since: self.since, + until: self.until, page: Some(page), per_page: self.per_page, } } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { + since: self.since, + until: self.until, page: self.page, per_page: Some(per_page), } } } -impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsParams { +impl<'enc> From<&'enc PerPage> for CopilotCopilotMetricsForEnterpriseParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -485,38 +645,66 @@ impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsParams { } } } -/// Query parameters for the [List all Copilot seat assignments for an enterprise](Copilot::list_copilot_seats_for_enterprise_async()) endpoint. +/// Query parameters for the [Get Copilot metrics for an enterprise team](Copilot::copilot_metrics_for_enterprise_team_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotListCopilotSeatsForEnterpriseParams { +pub struct CopilotCopilotMetricsForEnterpriseTeamParams<'req> { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + since: Option<&'req str>, + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + until: Option<&'req str>, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option, - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option } -impl CopilotListCopilotSeatsForEnterpriseParams { +impl<'req> CopilotCopilotMetricsForEnterpriseTeamParams<'req> { pub fn new() -> Self { Self::default() } + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + pub fn since(self, since: &'req str) -> Self { + Self { + since: Some(since), + until: self.until, + page: self.page, + per_page: self.per_page, + } + } + + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + pub fn until(self, until: &'req str) -> Self { + Self { + since: self.since, + until: Some(until), + page: self.page, + per_page: self.per_page, + } + } + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { + since: self.since, + until: self.until, page: Some(page), per_page: self.per_page, } } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { + since: self.since, + until: self.until, page: self.page, per_page: Some(per_page), } } } -impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsForEnterpriseParams { +impl<'enc> From<&'enc PerPage> for CopilotCopilotMetricsForEnterpriseTeamParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -525,9 +713,9 @@ impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsForEnterpriseParams { } } } -/// Query parameters for the [Get a summary of Copilot usage for enterprise members](Copilot::usage_metrics_for_enterprise_async()) endpoint. +/// Query parameters for the [Get Copilot metrics for an organization](Copilot::copilot_metrics_for_organization_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotUsageMetricsForEnterpriseParams<'req> { +pub struct CopilotCopilotMetricsForOrganizationParams<'req> { /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. since: Option<&'req str>, /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. @@ -538,7 +726,7 @@ pub struct CopilotUsageMetricsForEnterpriseParams<'req> { per_page: Option } -impl<'req> CopilotUsageMetricsForEnterpriseParams<'req> { +impl<'req> CopilotCopilotMetricsForOrganizationParams<'req> { pub fn new() -> Self { Self::default() } @@ -584,7 +772,7 @@ impl<'req> CopilotUsageMetricsForEnterpriseParams<'req> { } } -impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseParams<'enc> { +impl<'enc> From<&'enc PerPage> for CopilotCopilotMetricsForOrganizationParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -593,9 +781,9 @@ impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseParams<'enc> } } } -/// Query parameters for the [Get a summary of Copilot usage for an enterprise team](Copilot::usage_metrics_for_enterprise_team_async()) endpoint. +/// Query parameters for the [Get Copilot metrics for a team](Copilot::copilot_metrics_for_team_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotUsageMetricsForEnterpriseTeamParams<'req> { +pub struct CopilotCopilotMetricsForTeamParams<'req> { /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. since: Option<&'req str>, /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. @@ -606,7 +794,7 @@ pub struct CopilotUsageMetricsForEnterpriseTeamParams<'req> { per_page: Option } -impl<'req> CopilotUsageMetricsForEnterpriseTeamParams<'req> { +impl<'req> CopilotCopilotMetricsForTeamParams<'req> { pub fn new() -> Self { Self::default() } @@ -652,7 +840,7 @@ impl<'req> CopilotUsageMetricsForEnterpriseTeamParams<'req> { } } -impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseTeamParams<'enc> { +impl<'enc> From<&'enc PerPage> for CopilotCopilotMetricsForTeamParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -661,66 +849,78 @@ impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseTeamParams<'e } } } -/// Query parameters for the [Get a summary of Copilot usage for organization members](Copilot::usage_metrics_for_org_async()) endpoint. +/// Query parameters for the [List all Copilot seat assignments for an organization](Copilot::list_copilot_seats_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotUsageMetricsForOrgParams<'req> { - /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. - since: Option<&'req str>, - /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. - until: Option<&'req str>, +pub struct CopilotListCopilotSeatsParams { /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option, - /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option } -impl<'req> CopilotUsageMetricsForOrgParams<'req> { +impl CopilotListCopilotSeatsParams { pub fn new() -> Self { Self::default() } - /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. - pub fn since(self, since: &'req str) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { - since: Some(since), - until: self.until, - page: self.page, + page: Some(page), per_page: self.per_page, } } - /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. - pub fn until(self, until: &'req str) -> Self { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { Self { - since: self.since, - until: Some(until), page: self.page, - per_page: self.per_page, + per_page: Some(per_page), + } + } +} + +impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsParams { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() } } +} +/// Query parameters for the [List all Copilot seat assignments for an enterprise](Copilot::list_copilot_seats_for_enterprise_async()) endpoint. +#[derive(Default, Serialize)] +pub struct CopilotListCopilotSeatsForEnterpriseParams { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option +} + +impl CopilotListCopilotSeatsForEnterpriseParams { + pub fn new() -> Self { + Self::default() + } /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { - since: self.since, - until: self.until, page: Some(page), per_page: self.per_page, } } - /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { - since: self.since, - until: self.until, page: self.page, per_page: Some(per_page), } } } -impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForOrgParams<'enc> { +impl<'enc> From<&'enc PerPage> for CopilotListCopilotSeatsForEnterpriseParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -729,9 +929,9 @@ impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForOrgParams<'enc> { } } } -/// Query parameters for the [Get a summary of Copilot usage for a team](Copilot::usage_metrics_for_team_async()) endpoint. +/// Query parameters for the [Get a summary of Copilot usage for enterprise members](Copilot::usage_metrics_for_enterprise_async()) endpoint. #[derive(Default, Serialize)] -pub struct CopilotUsageMetricsForTeamParams<'req> { +pub struct CopilotUsageMetricsForEnterpriseParams<'req> { /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. since: Option<&'req str>, /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. @@ -742,7 +942,7 @@ pub struct CopilotUsageMetricsForTeamParams<'req> { per_page: Option } -impl<'req> CopilotUsageMetricsForTeamParams<'req> { +impl<'req> CopilotUsageMetricsForEnterpriseParams<'req> { pub fn new() -> Self { Self::default() } @@ -777,60 +977,723 @@ impl<'req> CopilotUsageMetricsForTeamParams<'req> { } } - /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { - Self { - since: self.since, - until: self.until, - page: self.page, - per_page: Some(per_page), - } - } -} + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: self.page, + per_page: Some(per_page), + } + } +} + +impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [Get a summary of Copilot usage for an enterprise team](Copilot::usage_metrics_for_enterprise_team_async()) endpoint. +#[derive(Default, Serialize)] +pub struct CopilotUsageMetricsForEnterpriseTeamParams<'req> { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + since: Option<&'req str>, + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + until: Option<&'req str>, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option +} + +impl<'req> CopilotUsageMetricsForEnterpriseTeamParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + pub fn since(self, since: &'req str) -> Self { + Self { + since: Some(since), + until: self.until, + page: self.page, + per_page: self.per_page, + } + } + + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + pub fn until(self, until: &'req str) -> Self { + Self { + since: self.since, + until: Some(until), + page: self.page, + per_page: self.per_page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: Some(page), + per_page: self.per_page, + } + } + + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: self.page, + per_page: Some(per_page), + } + } +} + +impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForEnterpriseTeamParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [Get a summary of Copilot usage for organization members](Copilot::usage_metrics_for_org_async()) endpoint. +#[derive(Default, Serialize)] +pub struct CopilotUsageMetricsForOrgParams<'req> { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + since: Option<&'req str>, + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + until: Option<&'req str>, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option +} + +impl<'req> CopilotUsageMetricsForOrgParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + pub fn since(self, since: &'req str) -> Self { + Self { + since: Some(since), + until: self.until, + page: self.page, + per_page: self.per_page, + } + } + + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + pub fn until(self, until: &'req str) -> Self { + Self { + since: self.since, + until: Some(until), + page: self.page, + per_page: self.per_page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: Some(page), + per_page: self.per_page, + } + } + + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: self.page, + per_page: Some(per_page), + } + } +} + +impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForOrgParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [Get a summary of Copilot usage for a team](Copilot::usage_metrics_for_team_async()) endpoint. +#[derive(Default, Serialize)] +pub struct CopilotUsageMetricsForTeamParams<'req> { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + since: Option<&'req str>, + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + until: Option<&'req str>, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option +} + +impl<'req> CopilotUsageMetricsForTeamParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + pub fn since(self, since: &'req str) -> Self { + Self { + since: Some(since), + until: self.until, + page: self.page, + per_page: self.per_page, + } + } + + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + pub fn until(self, until: &'req str) -> Self { + Self { + since: self.since, + until: Some(until), + page: self.page, + per_page: self.per_page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: Some(page), + per_page: self.per_page, + } + } + + /// The number of days of metrics to display per page (max 28). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + since: self.since, + until: self.until, + page: self.page, + per_page: Some(per_page), + } + } +} + +impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForTeamParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} + +impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::Err> { + /// --- + /// + /// # Add teams to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can add Copilot seats for their organization members. + /// + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for add_copilot_seats_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization) + /// + /// --- + pub async fn add_copilot_seats_for_teams_async(&self, org: &str, body: PostCopilotAddCopilotSeatsForTeams) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "POST", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json_async().await?) + } else { + match github_response.status_code() { + 500 => Err(CopilotAddCopilotSeatsForTeamsError::Status500(github_response.to_json_async().await?).into()), + 401 => Err(CopilotAddCopilotSeatsForTeamsError::Status401(github_response.to_json_async().await?).into()), + 403 => Err(CopilotAddCopilotSeatsForTeamsError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotAddCopilotSeatsForTeamsError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotAddCopilotSeatsForTeamsError::Status422.into()), + code => Err(CopilotAddCopilotSeatsForTeamsError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Add teams to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can add Copilot seats for their organization members. + /// + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for add_copilot_seats_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn add_copilot_seats_for_teams(&self, org: &str, body: PostCopilotAddCopilotSeatsForTeams) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "POST", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json()?) + } else { + match github_response.status_code() { + 500 => Err(CopilotAddCopilotSeatsForTeamsError::Status500(github_response.to_json()?).into()), + 401 => Err(CopilotAddCopilotSeatsForTeamsError::Status401(github_response.to_json()?).into()), + 403 => Err(CopilotAddCopilotSeatsForTeamsError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotAddCopilotSeatsForTeamsError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotAddCopilotSeatsForTeamsError::Status422.into()), + code => Err(CopilotAddCopilotSeatsForTeamsError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Add users to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can add Copilot seats for their organization members. + /// + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for add_copilot_seats_for_users](https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization) + /// + /// --- + pub async fn add_copilot_seats_for_users_async(&self, org: &str, body: PostCopilotAddCopilotSeatsForUsers) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "POST", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json_async().await?) + } else { + match github_response.status_code() { + 500 => Err(CopilotAddCopilotSeatsForUsersError::Status500(github_response.to_json_async().await?).into()), + 401 => Err(CopilotAddCopilotSeatsForUsersError::Status401(github_response.to_json_async().await?).into()), + 403 => Err(CopilotAddCopilotSeatsForUsersError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotAddCopilotSeatsForUsersError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotAddCopilotSeatsForUsersError::Status422.into()), + code => Err(CopilotAddCopilotSeatsForUsersError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Add users to the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// Only organization owners can add Copilot seats for their organization members. + /// + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for add_copilot_seats_for_users](https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn add_copilot_seats_for_users(&self, org: &str, body: PostCopilotAddCopilotSeatsForUsers) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "POST", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json()?) + } else { + match github_response.status_code() { + 500 => Err(CopilotAddCopilotSeatsForUsersError::Status500(github_response.to_json()?).into()), + 401 => Err(CopilotAddCopilotSeatsForUsersError::Status401(github_response.to_json()?).into()), + 403 => Err(CopilotAddCopilotSeatsForUsersError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotAddCopilotSeatsForUsersError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotAddCopilotSeatsForUsersError::Status422.into()), + code => Err(CopilotAddCopilotSeatsForUsersError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Remove teams from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. + /// + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response will contain the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for cancel_copilot_seat_assignment_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization) + /// + /// --- + pub async fn cancel_copilot_seat_assignment_for_teams_async(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForTeams) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json_async().await?) + } else { + match github_response.status_code() { + 500 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status500(github_response.to_json_async().await?).into()), + 401 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status401(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status422.into()), + code => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Remove teams from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. + /// + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response will contain the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for cancel_copilot_seat_assignment_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn cancel_copilot_seat_assignment_for_teams(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForTeams) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json()?) + } else { + match github_response.status_code() { + 500 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status500(github_response.to_json()?).into()), + 401 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status401(github_response.to_json()?).into()), + 403 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status422.into()), + code => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Remove users from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. + /// + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response will contain the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for cancel_copilot_seat_assignment_for_users](https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization) + /// + /// --- + pub async fn cancel_copilot_seat_assignment_for_users_async(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForUsers) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json_async().await?) + } else { + match github_response.status_code() { + 500 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status500(github_response.to_json_async().await?).into()), + 401 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status401(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status422.into()), + code => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Remove users from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. + /// + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response will contain the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// [GitHub API docs for cancel_copilot_seat_assignment_for_users](https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn cancel_copilot_seat_assignment_for_users(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForUsers) -> Result { + + let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- -impl<'enc> From<&'enc PerPage> for CopilotUsageMetricsForTeamParams<'enc> { - fn from(per_page: &'enc PerPage) -> Self { - Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json()?) + } else { + match github_response.status_code() { + 500 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status500(github_response.to_json()?).into()), + 401 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status401(github_response.to_json()?).into()), + 403 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status422.into()), + code => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Generic { code }.into()), + } } } -} -impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::Err> { /// --- /// - /// # Add teams to the Copilot subscription for an organization + /// # Get Copilot metrics for an enterprise /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. - /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// Only organization owners can add Copilot seats for their organization members. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for add_copilot_seats_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_enterprise](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise) /// /// --- - pub async fn add_copilot_seats_for_teams_async(&self, org: &str, body: PostCopilotAddCopilotSeatsForTeams) -> Result { + pub async fn copilot_metrics_for_enterprise_async(&self, enterprise: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/enterprises/{}/copilot/metrics", super::GITHUB_BASE_API_URL, enterprise); + if let Some(params) = query_params { + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(params.into())?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None::, + method: "GET", headers: vec![] }; @@ -846,49 +1709,48 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 500 => Err(CopilotAddCopilotSeatsForTeamsError::Status500(github_response.to_json_async().await?).into()), - 401 => Err(CopilotAddCopilotSeatsForTeamsError::Status401(github_response.to_json_async().await?).into()), - 403 => Err(CopilotAddCopilotSeatsForTeamsError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(CopilotAddCopilotSeatsForTeamsError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(CopilotAddCopilotSeatsForTeamsError::Status422.into()), - code => Err(CopilotAddCopilotSeatsForTeamsError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForEnterpriseError::Status500(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCopilotMetricsForEnterpriseError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCopilotMetricsForEnterpriseError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCopilotMetricsForEnterpriseError::Status422(github_response.to_json_async().await?).into()), + code => Err(CopilotCopilotMetricsForEnterpriseError::Generic { code }.into()), } } } /// --- /// - /// # Add teams to the Copilot subscription for an organization + /// # Get Copilot metrics for an enterprise /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// Only organization owners can add Copilot seats for their organization members. - /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for add_copilot_seats_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_enterprise](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn add_copilot_seats_for_teams(&self, org: &str, body: PostCopilotAddCopilotSeatsForTeams) -> Result { + pub fn copilot_metrics_for_enterprise(&self, enterprise: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/enterprises/{}/copilot/metrics", super::GITHUB_BASE_API_URL, enterprise); + if let Some(params) = query_params { + request_uri.push_str("?"); + let qp: CopilotCopilotMetricsForEnterpriseParams = params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None, + method: "GET", headers: vec![] }; @@ -904,48 +1766,49 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json()?) } else { match github_response.status_code() { - 500 => Err(CopilotAddCopilotSeatsForTeamsError::Status500(github_response.to_json()?).into()), - 401 => Err(CopilotAddCopilotSeatsForTeamsError::Status401(github_response.to_json()?).into()), - 403 => Err(CopilotAddCopilotSeatsForTeamsError::Status403(github_response.to_json()?).into()), - 404 => Err(CopilotAddCopilotSeatsForTeamsError::Status404(github_response.to_json()?).into()), - 422 => Err(CopilotAddCopilotSeatsForTeamsError::Status422.into()), - code => Err(CopilotAddCopilotSeatsForTeamsError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForEnterpriseError::Status500(github_response.to_json()?).into()), + 403 => Err(CopilotCopilotMetricsForEnterpriseError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCopilotMetricsForEnterpriseError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCopilotMetricsForEnterpriseError::Status422(github_response.to_json()?).into()), + code => Err(CopilotCopilotMetricsForEnterpriseError::Generic { code }.into()), } } } /// --- /// - /// # Add users to the Copilot subscription for an organization + /// # Get Copilot metrics for an enterprise team /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// Only organization owners can add Copilot seats for their organization members. + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for add_copilot_seats_for_users](https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_enterprise_team](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team) /// /// --- - pub async fn add_copilot_seats_for_users_async(&self, org: &str, body: PostCopilotAddCopilotSeatsForUsers) -> Result { + pub async fn copilot_metrics_for_enterprise_team_async(&self, enterprise: &str, team_slug: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/enterprises/{}/team/{}/copilot/metrics", super::GITHUB_BASE_API_URL, enterprise, team_slug); + if let Some(params) = query_params { + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(params.into())?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None::, + method: "GET", headers: vec![] }; @@ -961,49 +1824,51 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 500 => Err(CopilotAddCopilotSeatsForUsersError::Status500(github_response.to_json_async().await?).into()), - 401 => Err(CopilotAddCopilotSeatsForUsersError::Status401(github_response.to_json_async().await?).into()), - 403 => Err(CopilotAddCopilotSeatsForUsersError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(CopilotAddCopilotSeatsForUsersError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(CopilotAddCopilotSeatsForUsersError::Status422.into()), - code => Err(CopilotAddCopilotSeatsForUsersError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status500(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status422(github_response.to_json_async().await?).into()), + code => Err(CopilotCopilotMetricsForEnterpriseTeamError::Generic { code }.into()), } } } /// --- /// - /// # Add users to the Copilot subscription for an organization + /// # Get Copilot metrics for an enterprise team /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. - /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Only organization owners can add Copilot seats for their organization members. + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for add_copilot_seats_for_users](https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_enterprise_team](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn add_copilot_seats_for_users(&self, org: &str, body: PostCopilotAddCopilotSeatsForUsers) -> Result { + pub fn copilot_metrics_for_enterprise_team(&self, enterprise: &str, team_slug: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/enterprises/{}/team/{}/copilot/metrics", super::GITHUB_BASE_API_URL, enterprise, team_slug); + if let Some(params) = query_params { + request_uri.push_str("?"); + let qp: CopilotCopilotMetricsForEnterpriseTeamParams = params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None, + method: "GET", headers: vec![] }; @@ -1019,46 +1884,49 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json()?) } else { match github_response.status_code() { - 500 => Err(CopilotAddCopilotSeatsForUsersError::Status500(github_response.to_json()?).into()), - 401 => Err(CopilotAddCopilotSeatsForUsersError::Status401(github_response.to_json()?).into()), - 403 => Err(CopilotAddCopilotSeatsForUsersError::Status403(github_response.to_json()?).into()), - 404 => Err(CopilotAddCopilotSeatsForUsersError::Status404(github_response.to_json()?).into()), - 422 => Err(CopilotAddCopilotSeatsForUsersError::Status422.into()), - code => Err(CopilotAddCopilotSeatsForUsersError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status500(github_response.to_json()?).into()), + 403 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCopilotMetricsForEnterpriseTeamError::Status422(github_response.to_json()?).into()), + code => Err(CopilotCopilotMetricsForEnterpriseTeamError::Generic { code }.into()), } } } /// --- /// - /// # Remove teams from the Copilot subscription for an organization + /// # Get Copilot metrics for an organization /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. - /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for cancel_copilot_seat_assignment_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_organization](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization) /// /// --- - pub async fn cancel_copilot_seat_assignment_for_teams_async(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForTeams) -> Result { + pub async fn copilot_metrics_for_organization_async(&self, org: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/copilot/metrics", super::GITHUB_BASE_API_URL, org); + if let Some(params) = query_params { + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(params.into())?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "DELETE", + body: None::, + method: "GET", headers: vec![] }; @@ -1074,47 +1942,51 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 500 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status500(github_response.to_json_async().await?).into()), - 401 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status401(github_response.to_json_async().await?).into()), - 403 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status422.into()), - code => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForOrganizationError::Status500(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCopilotMetricsForOrganizationError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCopilotMetricsForOrganizationError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCopilotMetricsForOrganizationError::Status422(github_response.to_json_async().await?).into()), + code => Err(CopilotCopilotMetricsForOrganizationError::Generic { code }.into()), } } } /// --- /// - /// # Remove teams from the Copilot subscription for an organization + /// # Get Copilot metrics for an organization /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. - /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for cancel_copilot_seat_assignment_for_teams](https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_organization](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn cancel_copilot_seat_assignment_for_teams(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForTeams) -> Result { + pub fn copilot_metrics_for_organization(&self, org: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_teams", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/copilot/metrics", super::GITHUB_BASE_API_URL, org); + if let Some(params) = query_params { + request_uri.push_str("?"); + let qp: CopilotCopilotMetricsForOrganizationParams = params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "DELETE", + body: None, + method: "GET", headers: vec![] }; @@ -1130,46 +2002,49 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json()?) } else { match github_response.status_code() { - 500 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status500(github_response.to_json()?).into()), - 401 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status401(github_response.to_json()?).into()), - 403 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status403(github_response.to_json()?).into()), - 404 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status404(github_response.to_json()?).into()), - 422 => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Status422.into()), - code => Err(CopilotCancelCopilotSeatAssignmentForTeamsError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForOrganizationError::Status500(github_response.to_json()?).into()), + 403 => Err(CopilotCopilotMetricsForOrganizationError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCopilotMetricsForOrganizationError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCopilotMetricsForOrganizationError::Status422(github_response.to_json()?).into()), + code => Err(CopilotCopilotMetricsForOrganizationError::Generic { code }.into()), } } } /// --- /// - /// # Remove users from the Copilot subscription for an organization + /// # Get Copilot metrics for a team /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. - /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for cancel_copilot_seat_assignment_for_users](https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_team](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team) /// /// --- - pub async fn cancel_copilot_seat_assignment_for_users_async(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForUsers) -> Result { + pub async fn copilot_metrics_for_team_async(&self, org: &str, team_slug: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/team/{}/copilot/metrics", super::GITHUB_BASE_API_URL, org, team_slug); + if let Some(params) = query_params { + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(params.into())?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "DELETE", + body: None::, + method: "GET", headers: vec![] }; @@ -1185,47 +2060,51 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 500 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status500(github_response.to_json_async().await?).into()), - 401 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status401(github_response.to_json_async().await?).into()), - 403 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status422.into()), - code => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForTeamError::Status500(github_response.to_json_async().await?).into()), + 403 => Err(CopilotCopilotMetricsForTeamError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(CopilotCopilotMetricsForTeamError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(CopilotCopilotMetricsForTeamError::Status422(github_response.to_json_async().await?).into()), + code => Err(CopilotCopilotMetricsForTeamError::Generic { code }.into()), } } } /// --- /// - /// # Remove users from the Copilot subscription for an organization + /// # Get Copilot metrics for a team /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. - /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// - /// [GitHub API docs for cancel_copilot_seat_assignment_for_users](https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization) + /// [GitHub API docs for copilot_metrics_for_team](https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn cancel_copilot_seat_assignment_for_users(&self, org: &str, body: DeleteCopilotCancelCopilotSeatAssignmentForUsers) -> Result { + pub fn copilot_metrics_for_team(&self, org: &str, team_slug: &str, query_params: Option>>) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/copilot/billing/selected_users", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/team/{}/copilot/metrics", super::GITHUB_BASE_API_URL, org, team_slug); + if let Some(params) = query_params { + request_uri.push_str("?"); + let qp: CopilotCopilotMetricsForTeamParams = params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); + } let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "DELETE", + body: None, + method: "GET", headers: vec![] }; @@ -1241,12 +2120,11 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E Ok(github_response.to_json()?) } else { match github_response.status_code() { - 500 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status500(github_response.to_json()?).into()), - 401 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status401(github_response.to_json()?).into()), - 403 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status403(github_response.to_json()?).into()), - 404 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status404(github_response.to_json()?).into()), - 422 => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Status422.into()), - code => Err(CopilotCancelCopilotSeatAssignmentForUsersError::Generic { code }.into()), + 500 => Err(CopilotCopilotMetricsForTeamError::Status500(github_response.to_json()?).into()), + 403 => Err(CopilotCopilotMetricsForTeamError::Status403(github_response.to_json()?).into()), + 404 => Err(CopilotCopilotMetricsForTeamError::Status404(github_response.to_json()?).into()), + 422 => Err(CopilotCopilotMetricsForTeamError::Status422(github_response.to_json()?).into()), + code => Err(CopilotCopilotMetricsForTeamError::Generic { code }.into()), } } } @@ -1256,11 +2134,11 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Gets information about an organization's Copilot subscription, including seat breakdown /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// @@ -1308,11 +2186,11 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Gets information about an organization's Copilot subscription, including seat breakdown /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// @@ -1361,9 +2239,12 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get Copilot seat assignment details for a user /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. + /// + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -1411,9 +2292,12 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get Copilot seat assignment details for a user /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -1462,11 +2346,14 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. /// Only organization owners can view assigned seats. /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// /// [GitHub API docs for list_copilot_seats](https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization) @@ -1514,11 +2401,14 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. /// Only organization owners can view assigned seats. /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// /// [GitHub API docs for list_copilot_seats](https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization) @@ -1568,13 +2458,16 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # List all Copilot seat assignments for an enterprise /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. /// /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. /// /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. /// @@ -1625,13 +2518,16 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # List all Copilot seat assignments for an enterprise /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. /// /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. /// /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. /// @@ -1684,7 +2580,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, @@ -1694,6 +2590,8 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. + /// /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. @@ -1743,7 +2641,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, @@ -1753,6 +2651,8 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. + /// /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. @@ -1804,7 +2704,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -1866,7 +2766,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -1930,7 +2830,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for organization members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -1989,7 +2889,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for organization members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -2050,7 +2950,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -2112,7 +3012,7 @@ impl<'api, C: Client> Copilot<'api, C> where AdapterError: From<::E /// # Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. diff --git a/src/endpoints/dependabot.rs b/src/endpoints/dependabot.rs index 45068e8..1276c72 100644 --- a/src/endpoints/dependabot.rs +++ b/src/endpoints/dependabot.rs @@ -1029,7 +1029,7 @@ pub struct DependabotListAlertsForRepoParams<'req> { sort: Option<&'req str>, /// The direction to sort the results by. direction: Option<&'req str>, - /// **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. page: Option, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, @@ -1208,7 +1208,7 @@ impl<'req> DependabotListAlertsForRepoParams<'req> { } } - /// **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. pub fn page(self, page: u16) -> Self { Self { state: self.state, @@ -1494,7 +1494,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(DependabotAddSelectedRepoToOrgSecretError::Status409.into()), @@ -1538,7 +1538,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(DependabotAddSelectedRepoToOrgSecretError::Status409.into()), @@ -1749,7 +1749,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotDeleteOrgSecretError::Generic { code }.into()), @@ -1790,7 +1790,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotDeleteOrgSecretError::Generic { code }.into()), @@ -1830,7 +1830,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotDeleteRepoSecretError::Generic { code }.into()), @@ -1871,7 +1871,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotDeleteRepoSecretError::Generic { code }.into()), @@ -2908,7 +2908,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Status409.into()), @@ -2952,7 +2952,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Status409.into()), @@ -2995,7 +2995,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotSetSelectedReposForOrgSecretError::Generic { code }.into()), @@ -3038,7 +3038,7 @@ impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(DependabotSetSelectedReposForOrgSecretError::Generic { code }.into()), diff --git a/src/endpoints/gists.rs b/src/endpoints/gists.rs index 8bf5353..32f387f 100644 --- a/src/endpoints/gists.rs +++ b/src/endpoints/gists.rs @@ -981,7 +981,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsCheckIsStarredError::Status404(github_response.to_json_async().await?).into()), @@ -1021,7 +1021,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsCheckIsStarredError::Status404(github_response.to_json()?).into()), @@ -1244,7 +1244,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsDeleteError::Status404(github_response.to_json_async().await?).into()), @@ -1284,7 +1284,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsDeleteError::Status404(github_response.to_json()?).into()), @@ -1323,7 +1323,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(GistsDeleteCommentError::Status304.into()), @@ -1363,7 +1363,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(GistsDeleteCommentError::Status304.into()), @@ -2408,7 +2408,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsStarError::Status404(github_response.to_json_async().await?).into()), @@ -2450,7 +2450,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(GistsStarError::Status404(github_response.to_json()?).into()), @@ -2489,7 +2489,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(GistsUnstarError::Status304.into()), @@ -2529,7 +2529,7 @@ impl<'api, C: Client> Gists<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(GistsUnstarError::Status304.into()), diff --git a/src/endpoints/git.rs b/src/endpoints/git.rs index bc127b1..b90b684 100644 --- a/src/endpoints/git.rs +++ b/src/endpoints/git.rs @@ -990,7 +990,7 @@ impl<'api, C: Client> Git<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(GitDeleteRefError::Status422(github_response.to_json_async().await?).into()), @@ -1031,7 +1031,7 @@ impl<'api, C: Client> Git<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(GitDeleteRefError::Status422(github_response.to_json()?).into()), diff --git a/src/endpoints/interactions.rs b/src/endpoints/interactions.rs index 644c71a..53166db 100644 --- a/src/endpoints/interactions.rs +++ b/src/endpoints/interactions.rs @@ -500,7 +500,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForAuthenticatedUserError::Generic { code }.into()), @@ -539,7 +539,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForAuthenticatedUserError::Generic { code }.into()), @@ -577,7 +577,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForOrgError::Generic { code }.into()), @@ -616,7 +616,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForOrgError::Generic { code }.into()), @@ -654,7 +654,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForRepoError::Status409.into()), @@ -694,7 +694,7 @@ impl<'api, C: Client> Interactions<'api, C> where AdapterError: From< Err(InteractionsRemoveRestrictionsForRepoError::Status409.into()), diff --git a/src/endpoints/issues.rs b/src/endpoints/issues.rs index 60ed530..52305d7 100644 --- a/src/endpoints/issues.rs +++ b/src/endpoints/issues.rs @@ -2588,7 +2588,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesCheckUserCanBeAssignedError::Status404(github_response.to_json_async().await?).into()), @@ -2632,7 +2632,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesCheckUserCanBeAssignedError::Status404(github_response.to_json()?).into()), @@ -2675,7 +2675,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesCheckUserCanBeAssignedToIssueError::Status404(github_response.to_json_async().await?).into()), @@ -2719,7 +2719,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesCheckUserCanBeAssignedToIssueError::Status404(github_response.to_json()?).into()), @@ -3138,7 +3138,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(IssuesDeleteCommentError::Generic { code }.into()), @@ -3177,7 +3177,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(IssuesDeleteCommentError::Generic { code }.into()), @@ -3215,7 +3215,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(IssuesDeleteLabelError::Generic { code }.into()), @@ -3254,7 +3254,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(IssuesDeleteLabelError::Generic { code }.into()), @@ -3292,7 +3292,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesDeleteMilestoneError::Status404(github_response.to_json_async().await?).into()), @@ -3332,7 +3332,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(IssuesDeleteMilestoneError::Status404(github_response.to_json()?).into()), @@ -5192,7 +5192,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(IssuesLockError::Status403(github_response.to_json_async().await?).into()), @@ -5237,7 +5237,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(IssuesLockError::Status403(github_response.to_json()?).into()), @@ -5279,7 +5279,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 301 => Err(IssuesRemoveAllLabelsError::Status301(github_response.to_json_async().await?).into()), @@ -5321,7 +5321,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 301 => Err(IssuesRemoveAllLabelsError::Status301(github_response.to_json()?).into()), @@ -5607,7 +5607,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(IssuesUnlockError::Status403(github_response.to_json_async().await?).into()), @@ -5648,7 +5648,7 @@ impl<'api, C: Client> Issues<'api, C> where AdapterError: From<::Er // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(IssuesUnlockError::Status403(github_response.to_json()?).into()), diff --git a/src/endpoints/migrations.rs b/src/endpoints/migrations.rs index a319247..9a6e980 100644 --- a/src/endpoints/migrations.rs +++ b/src/endpoints/migrations.rs @@ -876,7 +876,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for cancel_import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) /// @@ -902,7 +902,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 503 => Err(MigrationsCancelImportError::Status503(github_response.to_json_async().await?).into()), @@ -918,7 +918,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for cancel_import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) /// @@ -945,7 +945,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 503 => Err(MigrationsCancelImportError::Status503(github_response.to_json()?).into()), @@ -984,7 +984,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsDeleteArchiveForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -1027,7 +1027,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsDeleteArchiveForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -1069,7 +1069,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsDeleteArchiveForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -1109,7 +1109,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsDeleteArchiveForOrgError::Status404(github_response.to_json()?).into()), @@ -1148,7 +1148,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(MigrationsDownloadArchiveForOrgError::Status302.into()), @@ -1189,7 +1189,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(MigrationsDownloadArchiveForOrgError::Status302.into()), @@ -1249,7 +1249,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(MigrationsGetArchiveForAuthenticatedUserError::Status302.into()), @@ -1312,7 +1312,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(MigrationsGetArchiveForAuthenticatedUserError::Status302.into()), @@ -1333,7 +1333,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for get_commit_authors](https://docs.github.com/rest/migrations/source-imports#get-commit-authors) /// @@ -1382,7 +1382,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for get_commit_authors](https://docs.github.com/rest/migrations/source-imports#get-commit-authors) /// @@ -1431,7 +1431,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -1507,7 +1507,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -1584,7 +1584,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for get_large_files](https://docs.github.com/rest/migrations/source-imports#get-large-files) /// @@ -1626,7 +1626,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for get_large_files](https://docs.github.com/rest/migrations/source-imports#get-large-files) /// @@ -2238,7 +2238,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for map_commit_author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) /// @@ -2283,7 +2283,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for map_commit_author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) /// @@ -2332,7 +2332,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for set_lfs_preference](https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference) /// @@ -2379,7 +2379,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for set_lfs_preference](https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference) /// @@ -2591,7 +2591,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for start_import](https://docs.github.com/rest/migrations/source-imports#start-an-import) /// @@ -2637,7 +2637,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for start_import](https://docs.github.com/rest/migrations/source-imports#start-an-import) /// @@ -2705,7 +2705,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(MigrationsUnlockRepoForAuthenticatedUserError::Status304.into()), @@ -2748,7 +2748,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(MigrationsUnlockRepoForAuthenticatedUserError::Status304.into()), @@ -2790,7 +2790,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsUnlockRepoForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -2830,7 +2830,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(MigrationsUnlockRepoForOrgError::Status404(github_response.to_json()?).into()), @@ -2851,7 +2851,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for update_import](https://docs.github.com/rest/migrations/source-imports#update-an-import) /// @@ -2898,7 +2898,7 @@ impl<'api, C: Client> Migrations<'api, C> where AdapterError: From< /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// [GitHub API docs for update_import](https://docs.github.com/rest/migrations/source-imports#update-an-import) /// diff --git a/src/endpoints/orgs.rs b/src/endpoints/orgs.rs index 9ce6db1..2f97260 100644 --- a/src/endpoints/orgs.rs +++ b/src/endpoints/orgs.rs @@ -633,6 +633,195 @@ impl From for AdapterError { } } +/// Errors for the [Get route stats by actor](Orgs::get_route_stats_by_actor_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetRouteStatsByActorError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetRouteStatsByActorError) -> Self { + let (description, status_code) = match err { + OrgsGetRouteStatsByActorError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get subject stats](Orgs::get_subject_stats_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetSubjectStatsError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetSubjectStatsError) -> Self { + let (description, status_code) = match err { + OrgsGetSubjectStatsError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get summary stats](Orgs::get_summary_stats_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetSummaryStatsError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetSummaryStatsError) -> Self { + let (description, status_code) = match err { + OrgsGetSummaryStatsError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get summary stats by actor](Orgs::get_summary_stats_by_actor_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetSummaryStatsByActorError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetSummaryStatsByActorError) -> Self { + let (description, status_code) = match err { + OrgsGetSummaryStatsByActorError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get summary stats by user](Orgs::get_summary_stats_by_user_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetSummaryStatsByUserError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetSummaryStatsByUserError) -> Self { + let (description, status_code) = match err { + OrgsGetSummaryStatsByUserError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get time stats](Orgs::get_time_stats_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetTimeStatsError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetTimeStatsError) -> Self { + let (description, status_code) = match err { + OrgsGetTimeStatsError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get time stats by actor](Orgs::get_time_stats_by_actor_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetTimeStatsByActorError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetTimeStatsByActorError) -> Self { + let (description, status_code) = match err { + OrgsGetTimeStatsByActorError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get time stats by user](Orgs::get_time_stats_by_user_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetTimeStatsByUserError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetTimeStatsByUserError) -> Self { + let (description, status_code) = match err { + OrgsGetTimeStatsByUserError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + +/// Errors for the [Get user stats](Orgs::get_user_stats_async()) endpoint. +#[derive(Debug, thiserror::Error)] +pub enum OrgsGetUserStatsError { + #[error("Status code: {}", code)] + Generic { code: u16 }, +} + +impl From for AdapterError { + fn from(err: OrgsGetUserStatsError) -> Self { + let (description, status_code) = match err { + OrgsGetUserStatsError::Generic { code } => (String::from("Generic"), code) + }; + + Self::Endpoint { + description, + status_code, + source: Some(Box::new(err)) + } + } +} + /// Errors for the [Get an organization webhook](Orgs::get_webhook_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum OrgsGetWebhookError { @@ -1909,69 +2098,102 @@ impl From for AdapterError { } -/// Query parameters for the [List organizations](Orgs::list_async()) endpoint. +/// Query parameters for the [Get route stats by actor](Orgs::get_route_stats_by_actor_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListParams { - /// An organization ID. Only return organizations with an ID greater than this ID. - since: Option, +pub struct OrgsGetRouteStatsByActorParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option + per_page: Option, + /// The direction to sort the results by. + direction: Option<&'req str>, + /// The property to sort the results by. + sort: Option> } -impl OrgsListParams { +impl<'req> OrgsGetRouteStatsByActorParams<'req> { pub fn new() -> Self { Self::default() } - /// An organization ID. Only return organizations with an ID greater than this ID. - pub fn since(self, since: i32) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - since: Some(since), + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: self.per_page, + direction: self.direction, + sort: self.sort, } } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - since: self.since, - per_page: Some(per_page), + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, + page: self.page, + per_page: self.per_page, + direction: self.direction, + sort: self.sort, } } -} -/// Query parameters for the [List app installations for an organization](Orgs::list_app_installations_async()) endpoint. -#[derive(Default, Serialize)] -pub struct OrgsListAppInstallationsParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option -} - -impl OrgsListAppInstallationsParams { - pub fn new() -> Self { - Self::default() + pub fn page(self, page: u16) -> Self { + Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: Some(page), + per_page: self.per_page, + direction: self.direction, + sort: self.sort, + } } /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: Some(per_page), + direction: self.direction, + sort: self.sort, + } + } + + /// The direction to sort the results by. + pub fn direction(self, direction: &'req str) -> Self { + Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, page: self.page, + per_page: self.per_page, + direction: Some(direction), + sort: self.sort, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The property to sort the results by. + pub fn sort(self, sort: Vec) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: self.per_page, - page: Some(page), + direction: self.direction, + sort: Some(sort), } } } -impl<'enc> From<&'enc PerPage> for OrgsListAppInstallationsParams { +impl<'enc> From<&'enc PerPage> for OrgsGetRouteStatsByActorParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -1980,82 +2202,102 @@ impl<'enc> From<&'enc PerPage> for OrgsListAppInstallationsParams { } } } -/// Query parameters for the [List attestations](Orgs::list_attestations_async()) endpoint. +/// Query parameters for the [Get subject stats](Orgs::get_subject_stats_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListAttestationsParams<'req> { +pub struct OrgsGetSubjectStatsParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - before: Option<&'req str>, - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - after: Option<&'req str> + /// The direction to sort the results by. + direction: Option<&'req str>, + /// The property to sort the results by. + sort: Option> } -impl<'req> OrgsListAttestationsParams<'req> { +impl<'req> OrgsGetSubjectStatsParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - before: self.before, - after: self.after, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, + per_page: self.per_page, + direction: self.direction, + sort: self.sort, } } - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn before(self, before: &'req str) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, + page: self.page, per_page: self.per_page, - before: Some(before), - after: self.after, + direction: self.direction, + sort: self.sort, } } - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn after(self, after: &'req str) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: Some(page), per_page: self.per_page, - before: self.before, - after: Some(after), + direction: self.direction, + sort: self.sort, } } -} - -/// Query parameters for the [List users blocked by an organization](Orgs::list_blocked_users_async()) endpoint. -#[derive(Default, Serialize)] -pub struct OrgsListBlockedUsersParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option -} - -impl OrgsListBlockedUsersParams { - pub fn new() -> Self { - Self::default() - } /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: Some(per_page), + direction: self.direction, + sort: self.sort, + } + } + + /// The direction to sort the results by. + pub fn direction(self, direction: &'req str) -> Self { + Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, page: self.page, + per_page: self.per_page, + direction: Some(direction), + sort: self.sort, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The property to sort the results by. + pub fn sort(self, sort: Vec) -> Self { Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: self.per_page, - page: Some(page), + direction: self.direction, + sort: Some(sort), } } } -impl<'enc> From<&'enc PerPage> for OrgsListBlockedUsersParams { +impl<'enc> From<&'enc PerPage> for OrgsGetSubjectStatsParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2064,279 +2306,327 @@ impl<'enc> From<&'enc PerPage> for OrgsListBlockedUsersParams { } } } -/// Query parameters for the [List custom property values for organization repositories](Orgs::list_custom_properties_values_for_repos_async()) endpoint. +/// Query parameters for the [Get summary stats](Orgs::get_summary_stats_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListCustomPropertiesValuesForReposParams<'req> { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option, - /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers. - repository_query: Option<&'req str> +pub struct OrgsGetSummaryStatsParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str } -impl<'req> OrgsListCustomPropertiesValuesForReposParams<'req> { +impl<'req> OrgsGetSummaryStatsParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - page: self.page, - repository_query: self.repository_query, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: Some(page), - repository_query: self.repository_query, + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, } } +} - /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers. - pub fn repository_query(self, repository_query: &'req str) -> Self { +/// Query parameters for the [Get summary stats by actor](Orgs::get_summary_stats_by_actor_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsGetSummaryStatsByActorParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str +} + +impl<'req> OrgsGetSummaryStatsByActorParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: self.page, - repository_query: Some(repository_query), + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, } } -} -impl<'enc> From<&'enc PerPage> for OrgsListCustomPropertiesValuesForReposParams<'enc> { - fn from(per_page: &'enc PerPage) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, } } } -/// Query parameters for the [List failed organization invitations](Orgs::list_failed_invitations_async()) endpoint. + +/// Query parameters for the [Get summary stats by user](Orgs::get_summary_stats_by_user_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListFailedInvitationsParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option +pub struct OrgsGetSummaryStatsByUserParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str } -impl OrgsListFailedInvitationsParams { +impl<'req> OrgsGetSummaryStatsByUserParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - page: self.page, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: Some(page), + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, } } } -impl<'enc> From<&'enc PerPage> for OrgsListFailedInvitationsParams { - fn from(per_page: &'enc PerPage) -> Self { - Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() - } - } -} -/// Query parameters for the [List organizations for the authenticated user](Orgs::list_for_authenticated_user_async()) endpoint. +/// Query parameters for the [Get time stats](Orgs::get_time_stats_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListForAuthenticatedUserParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option +pub struct OrgsGetTimeStatsParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + timestamp_increment: &'req str } -impl OrgsListForAuthenticatedUserParams { +impl<'req> OrgsGetTimeStatsParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - page: self.page, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: self.timestamp_increment, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: Some(page), + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, + timestamp_increment: self.timestamp_increment, } } -} -impl<'enc> From<&'enc PerPage> for OrgsListForAuthenticatedUserParams { - fn from(per_page: &'enc PerPage) -> Self { + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self { Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: timestamp_increment, } } } -/// Query parameters for the [List organizations for a user](Orgs::list_for_user_async()) endpoint. + +/// Query parameters for the [Get time stats by actor](Orgs::get_time_stats_by_actor_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListForUserParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option +pub struct OrgsGetTimeStatsByActorParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + timestamp_increment: &'req str } -impl OrgsListForUserParams { +impl<'req> OrgsGetTimeStatsByActorParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - page: self.page, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: self.timestamp_increment, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: Some(page), + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, + timestamp_increment: self.timestamp_increment, } } -} -impl<'enc> From<&'enc PerPage> for OrgsListForUserParams { - fn from(per_page: &'enc PerPage) -> Self { + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self { Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: timestamp_increment, } } } -/// Query parameters for the [List organization invitation teams](Orgs::list_invitation_teams_async()) endpoint. + +/// Query parameters for the [Get time stats by user](Orgs::get_time_stats_by_user_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListInvitationTeamsParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option +pub struct OrgsGetTimeStatsByUserParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + timestamp_increment: &'req str } -impl OrgsListInvitationTeamsParams { +impl<'req> OrgsGetTimeStatsByUserParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - per_page: Some(per_page), - page: self.page, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: self.timestamp_increment, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { Self { - per_page: self.per_page, - page: Some(page), + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, + timestamp_increment: self.timestamp_increment, } } -} -impl<'enc> From<&'enc PerPage> for OrgsListInvitationTeamsParams { - fn from(per_page: &'enc PerPage) -> Self { + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + pub fn timestamp_increment(self, timestamp_increment: &'req str) -> Self { Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + timestamp_increment: timestamp_increment, } } } -/// Query parameters for the [List organization members](Orgs::list_members_async()) endpoint. + +/// Query parameters for the [Get user stats](Orgs::get_user_stats_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListMembersParams<'req> { - /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. - filter: Option<&'req str>, - /// Filter members returned by their role. - role: Option<&'req str>, +pub struct OrgsGetUserStatsParams<'req> { + /// The minimum timestamp to query for stats + min_timestamp: &'req str, + /// The maximum timestamp to query for stats + max_timestamp: &'req str, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option + /// The direction to sort the results by. + direction: Option<&'req str>, + /// The property to sort the results by. + sort: Option> } -impl<'req> OrgsListMembersParams<'req> { +impl<'req> OrgsGetUserStatsParams<'req> { pub fn new() -> Self { Self::default() } - /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. - pub fn filter(self, filter: &'req str) -> Self { + /// The minimum timestamp to query for stats + pub fn min_timestamp(self, min_timestamp: &'req str) -> Self { Self { - filter: Some(filter), - role: self.role, + min_timestamp: min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: self.per_page, + direction: self.direction, + sort: self.sort, + } + } + + /// The maximum timestamp to query for stats + pub fn max_timestamp(self, max_timestamp: &'req str) -> Self { + Self { + min_timestamp: self.min_timestamp, + max_timestamp: max_timestamp, page: self.page, + per_page: self.per_page, + direction: self.direction, + sort: self.sort, } } - /// Filter members returned by their role. - pub fn role(self, role: &'req str) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { - filter: self.filter, - role: Some(role), + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: Some(page), per_page: self.per_page, - page: self.page, + direction: self.direction, + sort: self.sort, } } /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { - filter: self.filter, - role: self.role, + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: Some(per_page), + direction: self.direction, + sort: self.sort, + } + } + + /// The direction to sort the results by. + pub fn direction(self, direction: &'req str) -> Self { + Self { + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, page: self.page, + per_page: self.per_page, + direction: Some(direction), + sort: self.sort, } } - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { + /// The property to sort the results by. + pub fn sort(self, sort: Vec) -> Self { Self { - filter: self.filter, - role: self.role, + min_timestamp: self.min_timestamp, + max_timestamp: self.max_timestamp, + page: self.page, per_page: self.per_page, - page: Some(page), + direction: self.direction, + sort: Some(sort), } } } -impl<'enc> From<&'enc PerPage> for OrgsListMembersParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsGetUserStatsParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2345,35 +2635,54 @@ impl<'enc> From<&'enc PerPage> for OrgsListMembersParams<'enc> { } } } -/// Query parameters for the [List organization memberships for the authenticated user](Orgs::list_memberships_for_authenticated_user_async()) endpoint. +/// Query parameters for the [List organizations](Orgs::list_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListMembershipsForAuthenticatedUserParams<'req> { - /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. - state: Option<&'req str>, +pub struct OrgsListParams { + /// An organization ID. Only return organizations with an ID greater than this ID. + since: Option, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option + per_page: Option } -impl<'req> OrgsListMembershipsForAuthenticatedUserParams<'req> { +impl OrgsListParams { pub fn new() -> Self { Self::default() } - /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. - pub fn state(self, state: &'req str) -> Self { + /// An organization ID. Only return organizations with an ID greater than this ID. + pub fn since(self, since: i32) -> Self { Self { - state: Some(state), + since: Some(since), per_page: self.per_page, - page: self.page, } } /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { - state: self.state, + since: self.since, + per_page: Some(per_page), + } + } +} + +/// Query parameters for the [List app installations for an organization](Orgs::list_app_installations_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListAppInstallationsParams { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} + +impl OrgsListAppInstallationsParams { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { per_page: Some(per_page), page: self.page, } @@ -2382,14 +2691,13 @@ impl<'req> OrgsListMembershipsForAuthenticatedUserParams<'req> { /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { - state: self.state, per_page: self.per_page, page: Some(page), } } } -impl<'enc> From<&'enc PerPage> for OrgsListMembershipsForAuthenticatedUserParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsListAppInstallationsParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2398,16 +2706,60 @@ impl<'enc> From<&'enc PerPage> for OrgsListMembershipsForAuthenticatedUserParams } } } -/// Query parameters for the [List teams that are assigned to an organization role](Orgs::list_org_role_teams_async()) endpoint. +/// Query parameters for the [List attestations](Orgs::list_attestations_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListOrgRoleTeamsParams { +pub struct OrgsListAttestationsParams<'req> { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + before: Option<&'req str>, + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + after: Option<&'req str> +} + +impl<'req> OrgsListAttestationsParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + before: self.before, + after: self.after, + } + } + + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn before(self, before: &'req str) -> Self { + Self { + per_page: self.per_page, + before: Some(before), + after: self.after, + } + } + + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn after(self, after: &'req str) -> Self { + Self { + per_page: self.per_page, + before: self.before, + after: Some(after), + } + } +} + +/// Query parameters for the [List users blocked by an organization](Orgs::list_blocked_users_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListBlockedUsersParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option } -impl OrgsListOrgRoleTeamsParams { +impl OrgsListBlockedUsersParams { pub fn new() -> Self { Self::default() } @@ -2429,7 +2781,7 @@ impl OrgsListOrgRoleTeamsParams { } } -impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleTeamsParams { +impl<'enc> From<&'enc PerPage> for OrgsListBlockedUsersParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2438,16 +2790,18 @@ impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleTeamsParams { } } } -/// Query parameters for the [List users that are assigned to an organization role](Orgs::list_org_role_users_async()) endpoint. +/// Query parameters for the [List custom property values for organization repositories](Orgs::list_custom_properties_values_for_repos_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListOrgRoleUsersParams { +pub struct OrgsListCustomPropertiesValuesForReposParams<'req> { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option + page: Option, + /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers. + repository_query: Option<&'req str> } -impl OrgsListOrgRoleUsersParams { +impl<'req> OrgsListCustomPropertiesValuesForReposParams<'req> { pub fn new() -> Self { Self::default() } @@ -2457,6 +2811,7 @@ impl OrgsListOrgRoleUsersParams { Self { per_page: Some(per_page), page: self.page, + repository_query: self.repository_query, } } @@ -2465,11 +2820,21 @@ impl OrgsListOrgRoleUsersParams { Self { per_page: self.per_page, page: Some(page), + repository_query: self.repository_query, + } + } + + /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\" for a detailed list of qualifiers. + pub fn repository_query(self, repository_query: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + repository_query: Some(repository_query), } } } -impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleUsersParams { +impl<'enc> From<&'enc PerPage> for OrgsListCustomPropertiesValuesForReposParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2478,35 +2843,23 @@ impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleUsersParams { } } } -/// Query parameters for the [List outside collaborators for an organization](Orgs::list_outside_collaborators_async()) endpoint. +/// Query parameters for the [List failed organization invitations](Orgs::list_failed_invitations_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListOutsideCollaboratorsParams<'req> { - /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. - filter: Option<&'req str>, +pub struct OrgsListFailedInvitationsParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option } -impl<'req> OrgsListOutsideCollaboratorsParams<'req> { +impl OrgsListFailedInvitationsParams { pub fn new() -> Self { Self::default() } - /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. - pub fn filter(self, filter: &'req str) -> Self { - Self { - filter: Some(filter), - per_page: self.per_page, - page: self.page, - } - } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { - filter: self.filter, per_page: Some(per_page), page: self.page, } @@ -2515,14 +2868,13 @@ impl<'req> OrgsListOutsideCollaboratorsParams<'req> { /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { - filter: self.filter, per_page: self.per_page, page: Some(page), } } } -impl<'enc> From<&'enc PerPage> for OrgsListOutsideCollaboratorsParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsListFailedInvitationsParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2531,16 +2883,16 @@ impl<'enc> From<&'enc PerPage> for OrgsListOutsideCollaboratorsParams<'enc> { } } } -/// Query parameters for the [List repositories a fine-grained personal access token has access to](Orgs::list_pat_grant_repositories_async()) endpoint. +/// Query parameters for the [List organizations for the authenticated user](Orgs::list_for_authenticated_user_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPatGrantRepositoriesParams { +pub struct OrgsListForAuthenticatedUserParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option } -impl OrgsListPatGrantRepositoriesParams { +impl OrgsListForAuthenticatedUserParams { pub fn new() -> Self { Self::default() } @@ -2562,7 +2914,7 @@ impl OrgsListPatGrantRepositoriesParams { } } -impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRepositoriesParams { +impl<'enc> From<&'enc PerPage> for OrgsListForAuthenticatedUserParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2571,16 +2923,16 @@ impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRepositoriesParams { } } } -/// Query parameters for the [List repositories requested to be accessed by a fine-grained personal access token](Orgs::list_pat_grant_request_repositories_async()) endpoint. +/// Query parameters for the [List organizations for a user](Orgs::list_for_user_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPatGrantRequestRepositoriesParams { +pub struct OrgsListForUserParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option } -impl OrgsListPatGrantRequestRepositoriesParams { +impl OrgsListForUserParams { pub fn new() -> Self { Self::default() } @@ -2602,7 +2954,7 @@ impl OrgsListPatGrantRequestRepositoriesParams { } } -impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestRepositoriesParams { +impl<'enc> From<&'enc PerPage> for OrgsListForUserParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2611,30 +2963,16 @@ impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestRepositoriesParams { } } } -/// Query parameters for the [List requests to access organization resources with fine-grained personal access tokens](Orgs::list_pat_grant_requests_async()) endpoint. +/// Query parameters for the [List organization invitation teams](Orgs::list_invitation_teams_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPatGrantRequestsParams<'req> { +pub struct OrgsListInvitationTeamsParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option, - /// The property by which to sort the results. - sort: Option<&'req str>, - /// The direction to sort the results by. - direction: Option<&'req str>, - /// A list of owner usernames to use to filter the results. - owner: Option>, - /// The name of the repository to use to filter the results. - repository: Option<&'req str>, - /// The permission to use to filter the results. - permission: Option<&'req str>, - /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - last_used_before: Option>, - /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - last_used_after: Option> + page: Option } -impl<'req> OrgsListPatGrantRequestsParams<'req> { +impl OrgsListInvitationTeamsParams { pub fn new() -> Self { Self::default() } @@ -2644,13 +2982,6 @@ impl<'req> OrgsListPatGrantRequestsParams<'req> { Self { per_page: Some(per_page), page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } @@ -2659,123 +2990,79 @@ impl<'req> OrgsListPatGrantRequestsParams<'req> { Self { per_page: self.per_page, page: Some(page), - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } +} - /// The property by which to sort the results. - pub fn sort(self, sort: &'req str) -> Self { +impl<'enc> From<&'enc PerPage> for OrgsListInvitationTeamsParams { + fn from(per_page: &'enc PerPage) -> Self { Self { - per_page: self.per_page, - page: self.page, - sort: Some(sort), - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() } } +} +/// Query parameters for the [List organization members](Orgs::list_members_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListMembersParams<'req> { + /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. + filter: Option<&'req str>, + /// Filter members returned by their role. + role: Option<&'req str>, + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} - /// The direction to sort the results by. - pub fn direction(self, direction: &'req str) -> Self { - Self { - per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: Some(direction), - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, - } +impl<'req> OrgsListMembersParams<'req> { + pub fn new() -> Self { + Self::default() } - /// A list of owner usernames to use to filter the results. - pub fn owner(self, owner: Vec) -> Self { + /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. + pub fn filter(self, filter: &'req str) -> Self { Self { + filter: Some(filter), + role: self.role, per_page: self.per_page, page: self.page, - sort: self.sort, - direction: self.direction, - owner: Some(owner), - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } - /// The name of the repository to use to filter the results. - pub fn repository(self, repository: &'req str) -> Self { + /// Filter members returned by their role. + pub fn role(self, role: &'req str) -> Self { Self { + filter: self.filter, + role: Some(role), per_page: self.per_page, page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: Some(repository), - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } - /// The permission to use to filter the results. - pub fn permission(self, permission: &'req str) -> Self { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { Self { - per_page: self.per_page, + filter: self.filter, + role: self.role, + per_page: Some(per_page), page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: Some(permission), - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } - /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - pub fn last_used_before(self, last_used_before: chrono::DateTime) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { + filter: self.filter, + role: self.role, per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: Some(last_used_before), - last_used_after: self.last_used_after, + page: Some(page), } } +} - /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - pub fn last_used_after(self, last_used_after: chrono::DateTime) -> Self { - Self { - per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: Some(last_used_after), - } - } -} - -impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestsParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsListMembersParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2784,171 +3071,91 @@ impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestsParams<'enc> { } } } -/// Query parameters for the [List fine-grained personal access tokens with access to organization resources](Orgs::list_pat_grants_async()) endpoint. +/// Query parameters for the [List organization memberships for the authenticated user](Orgs::list_memberships_for_authenticated_user_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPatGrantsParams<'req> { +pub struct OrgsListMembershipsForAuthenticatedUserParams<'req> { + /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. + state: Option<&'req str>, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option, - /// The property by which to sort the results. - sort: Option<&'req str>, - /// The direction to sort the results by. - direction: Option<&'req str>, - /// A list of owner usernames to use to filter the results. - owner: Option>, - /// The name of the repository to use to filter the results. - repository: Option<&'req str>, - /// The permission to use to filter the results. - permission: Option<&'req str>, - /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - last_used_before: Option>, - /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - last_used_after: Option> + page: Option } -impl<'req> OrgsListPatGrantsParams<'req> { +impl<'req> OrgsListMembershipsForAuthenticatedUserParams<'req> { pub fn new() -> Self { Self::default() } - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { - Self { - per_page: Some(per_page), - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, - } - } - - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { - Self { - per_page: self.per_page, - page: Some(page), - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, - } - } - - /// The property by which to sort the results. - pub fn sort(self, sort: &'req str) -> Self { + /// Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. + pub fn state(self, state: &'req str) -> Self { Self { + state: Some(state), per_page: self.per_page, page: self.page, - sort: Some(sort), - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } - /// The direction to sort the results by. - pub fn direction(self, direction: &'req str) -> Self { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { Self { - per_page: self.per_page, + state: self.state, + per_page: Some(per_page), page: self.page, - sort: self.sort, - direction: Some(direction), - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, } } - /// A list of owner usernames to use to filter the results. - pub fn owner(self, owner: Vec) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { + state: self.state, per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: Some(owner), - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, + page: Some(page), } } +} - /// The name of the repository to use to filter the results. - pub fn repository(self, repository: &'req str) -> Self { +impl<'enc> From<&'enc PerPage> for OrgsListMembershipsForAuthenticatedUserParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { Self { - per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: Some(repository), - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() } } +} +/// Query parameters for the [List teams that are assigned to an organization role](Orgs::list_org_role_teams_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListOrgRoleTeamsParams { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} - /// The permission to use to filter the results. - pub fn permission(self, permission: &'req str) -> Self { - Self { - per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: Some(permission), - last_used_before: self.last_used_before, - last_used_after: self.last_used_after, - } +impl OrgsListOrgRoleTeamsParams { + pub fn new() -> Self { + Self::default() } - /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - pub fn last_used_before(self, last_used_before: chrono::DateTime) -> Self { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { Self { - per_page: self.per_page, + per_page: Some(per_page), page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: Some(last_used_before), - last_used_after: self.last_used_after, } } - /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - pub fn last_used_after(self, last_used_after: chrono::DateTime) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { per_page: self.per_page, - page: self.page, - sort: self.sort, - direction: self.direction, - owner: self.owner, - repository: self.repository, - permission: self.permission, - last_used_before: self.last_used_before, - last_used_after: Some(last_used_after), + page: Some(page), } } } -impl<'enc> From<&'enc PerPage> for OrgsListPatGrantsParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleTeamsParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -2957,20 +3164,16 @@ impl<'enc> From<&'enc PerPage> for OrgsListPatGrantsParams<'enc> { } } } -/// Query parameters for the [List pending organization invitations](Orgs::list_pending_invitations_async()) endpoint. +/// Query parameters for the [List users that are assigned to an organization role](Orgs::list_org_role_users_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPendingInvitationsParams<'req> { +pub struct OrgsListOrgRoleUsersParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option, - /// Filter invitations by their member role. - role: Option<&'req str>, - /// Filter invitations by their invitation source. - invitation_source: Option<&'req str> + page: Option } -impl<'req> OrgsListPendingInvitationsParams<'req> { +impl OrgsListOrgRoleUsersParams { pub fn new() -> Self { Self::default() } @@ -2980,8 +3183,6 @@ impl<'req> OrgsListPendingInvitationsParams<'req> { Self { per_page: Some(per_page), page: self.page, - role: self.role, - invitation_source: self.invitation_source, } } @@ -2990,33 +3191,11 @@ impl<'req> OrgsListPendingInvitationsParams<'req> { Self { per_page: self.per_page, page: Some(page), - role: self.role, - invitation_source: self.invitation_source, - } - } - - /// Filter invitations by their member role. - pub fn role(self, role: &'req str) -> Self { - Self { - per_page: self.per_page, - page: self.page, - role: Some(role), - invitation_source: self.invitation_source, - } - } - - /// Filter invitations by their invitation source. - pub fn invitation_source(self, invitation_source: &'req str) -> Self { - Self { - per_page: self.per_page, - page: self.page, - role: self.role, - invitation_source: Some(invitation_source), } } } -impl<'enc> From<&'enc PerPage> for OrgsListPendingInvitationsParams<'enc> { +impl<'enc> From<&'enc PerPage> for OrgsListOrgRoleUsersParams { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -3025,23 +3204,35 @@ impl<'enc> From<&'enc PerPage> for OrgsListPendingInvitationsParams<'enc> { } } } -/// Query parameters for the [List public organization members](Orgs::list_public_members_async()) endpoint. +/// Query parameters for the [List outside collaborators for an organization](Orgs::list_outside_collaborators_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListPublicMembersParams { +pub struct OrgsListOutsideCollaboratorsParams<'req> { + /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. + filter: Option<&'req str>, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" page: Option } -impl OrgsListPublicMembersParams { +impl<'req> OrgsListOutsideCollaboratorsParams<'req> { pub fn new() -> Self { Self::default() } + /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. + pub fn filter(self, filter: &'req str) -> Self { + Self { + filter: Some(filter), + per_page: self.per_page, + page: self.page, + } + } + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn per_page(self, per_page: u16) -> Self { Self { + filter: self.filter, per_page: Some(per_page), page: self.page, } @@ -3050,13 +3241,14 @@ impl OrgsListPublicMembersParams { /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" pub fn page(self, page: u16) -> Self { Self { + filter: self.filter, per_page: self.per_page, page: Some(page), } } } -impl<'enc> From<&'enc PerPage> for OrgsListPublicMembersParams { +impl<'enc> From<&'enc PerPage> for OrgsListOutsideCollaboratorsParams<'enc> { fn from(per_page: &'enc PerPage) -> Self { Self { per_page: Some(per_page.per_page), @@ -3065,18 +3257,16 @@ impl<'enc> From<&'enc PerPage> for OrgsListPublicMembersParams { } } } -/// Query parameters for the [List deliveries for an organization webhook](Orgs::list_webhook_deliveries_async()) endpoint. +/// Query parameters for the [List repositories a fine-grained personal access token has access to](Orgs::list_pat_grant_repositories_async()) endpoint. #[derive(Default, Serialize)] -pub struct OrgsListWebhookDeliveriesParams<'req> { +pub struct OrgsListPatGrantRepositoriesParams { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, - /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - cursor: Option<&'req str>, - - redelivery: Option + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option } -impl<'req> OrgsListWebhookDeliveriesParams<'req> { +impl OrgsListPatGrantRepositoriesParams { pub fn new() -> Self { Self::default() } @@ -3085,94 +3275,1365 @@ impl<'req> OrgsListWebhookDeliveriesParams<'req> { pub fn per_page(self, per_page: u16) -> Self { Self { per_page: Some(per_page), - cursor: self.cursor, - redelivery: self.redelivery, + page: self.page, } } - /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - pub fn cursor(self, cursor: &'req str) -> Self { + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { Self { per_page: self.per_page, - cursor: Some(cursor), - redelivery: self.redelivery, + page: Some(page), } } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRepositoriesParams { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List repositories requested to be accessed by a fine-grained personal access token](Orgs::list_pat_grant_request_repositories_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListPatGrantRequestRepositoriesParams { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} + +impl OrgsListPatGrantRequestRepositoriesParams { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestRepositoriesParams { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List requests to access organization resources with fine-grained personal access tokens](Orgs::list_pat_grant_requests_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListPatGrantRequestsParams<'req> { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The property by which to sort the results. + sort: Option<&'req str>, + /// The direction to sort the results by. + direction: Option<&'req str>, + /// A list of owner usernames to use to filter the results. + owner: Option>, + /// The name of the repository to use to filter the results. + repository: Option<&'req str>, + /// The permission to use to filter the results. + permission: Option<&'req str>, + /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + last_used_before: Option>, + /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + last_used_after: Option> +} + +impl<'req> OrgsListPatGrantRequestsParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The property by which to sort the results. + pub fn sort(self, sort: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: Some(sort), + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The direction to sort the results by. + pub fn direction(self, direction: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: Some(direction), + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// A list of owner usernames to use to filter the results. + pub fn owner(self, owner: Vec) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: Some(owner), + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The name of the repository to use to filter the results. + pub fn repository(self, repository: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: Some(repository), + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The permission to use to filter the results. + pub fn permission(self, permission: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: Some(permission), + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + pub fn last_used_before(self, last_used_before: chrono::DateTime) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: Some(last_used_before), + last_used_after: self.last_used_after, + } + } + + /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + pub fn last_used_after(self, last_used_after: chrono::DateTime) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: Some(last_used_after), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPatGrantRequestsParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List fine-grained personal access tokens with access to organization resources](Orgs::list_pat_grants_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListPatGrantsParams<'req> { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// The property by which to sort the results. + sort: Option<&'req str>, + /// The direction to sort the results by. + direction: Option<&'req str>, + /// A list of owner usernames to use to filter the results. + owner: Option>, + /// The name of the repository to use to filter the results. + repository: Option<&'req str>, + /// The permission to use to filter the results. + permission: Option<&'req str>, + /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + last_used_before: Option>, + /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + last_used_after: Option> +} + +impl<'req> OrgsListPatGrantsParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The property by which to sort the results. + pub fn sort(self, sort: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: Some(sort), + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The direction to sort the results by. + pub fn direction(self, direction: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: Some(direction), + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// A list of owner usernames to use to filter the results. + pub fn owner(self, owner: Vec) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: Some(owner), + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The name of the repository to use to filter the results. + pub fn repository(self, repository: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: Some(repository), + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// The permission to use to filter the results. + pub fn permission(self, permission: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: Some(permission), + last_used_before: self.last_used_before, + last_used_after: self.last_used_after, + } + } + + /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + pub fn last_used_before(self, last_used_before: chrono::DateTime) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: Some(last_used_before), + last_used_after: self.last_used_after, + } + } + + /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + pub fn last_used_after(self, last_used_after: chrono::DateTime) -> Self { + Self { + per_page: self.per_page, + page: self.page, + sort: self.sort, + direction: self.direction, + owner: self.owner, + repository: self.repository, + permission: self.permission, + last_used_before: self.last_used_before, + last_used_after: Some(last_used_after), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPatGrantsParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List pending organization invitations](Orgs::list_pending_invitations_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListPendingInvitationsParams<'req> { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option, + /// Filter invitations by their member role. + role: Option<&'req str>, + /// Filter invitations by their invitation source. + invitation_source: Option<&'req str> +} + +impl<'req> OrgsListPendingInvitationsParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + role: self.role, + invitation_source: self.invitation_source, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + role: self.role, + invitation_source: self.invitation_source, + } + } + + /// Filter invitations by their member role. + pub fn role(self, role: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + role: Some(role), + invitation_source: self.invitation_source, + } + } + + /// Filter invitations by their invitation source. + pub fn invitation_source(self, invitation_source: &'req str) -> Self { + Self { + per_page: self.per_page, + page: self.page, + role: self.role, + invitation_source: Some(invitation_source), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPendingInvitationsParams<'enc> { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List public organization members](Orgs::list_public_members_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListPublicMembersParams { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} + +impl OrgsListPublicMembersParams { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListPublicMembersParams { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} +/// Query parameters for the [List deliveries for an organization webhook](Orgs::list_webhook_deliveries_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListWebhookDeliveriesParams<'req> { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + cursor: Option<&'req str> +} + +impl<'req> OrgsListWebhookDeliveriesParams<'req> { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + cursor: self.cursor, + } + } + + /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + pub fn cursor(self, cursor: &'req str) -> Self { + Self { + per_page: self.per_page, + cursor: Some(cursor), + } + } +} + +/// Query parameters for the [List organization webhooks](Orgs::list_webhooks_async()) endpoint. +#[derive(Default, Serialize)] +pub struct OrgsListWebhooksParams { + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + per_page: Option, + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + page: Option +} + +impl OrgsListWebhooksParams { + pub fn new() -> Self { + Self::default() + } + + /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn per_page(self, per_page: u16) -> Self { + Self { + per_page: Some(per_page), + page: self.page, + } + } + + /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" + pub fn page(self, page: u16) -> Self { + Self { + per_page: self.per_page, + page: Some(page), + } + } +} + +impl<'enc> From<&'enc PerPage> for OrgsListWebhooksParams { + fn from(per_page: &'enc PerPage) -> Self { + Self { + per_page: Some(per_page.per_page), + page: Some(per_page.page), + ..Default::default() + } + } +} + +impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> { + /// --- + /// + /// # Add a security manager team + /// + /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team) + /// + /// --- + pub async fn add_security_manager_team_async(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Add a security manager team + /// + /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn add_security_manager_team(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Assign an organization role to a team + /// + /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team) + /// + /// --- + pub async fn assign_team_to_org_role_async(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()), + 422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()), + code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Assign an organization role to a team + /// + /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn assign_team_to_org_role(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()), + 422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()), + code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Assign an organization role to a user + /// + /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user) + /// + /// --- + pub async fn assign_user_to_org_role_async(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()), + 422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()), + code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Assign an organization role to a user + /// + /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn assign_user_to_org_role(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()), + 422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()), + code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Block a user from an organization + /// + /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// + /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization) + /// + /// --- + pub async fn block_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 422 => Err(OrgsBlockUserError::Status422(github_response.to_json_async().await?).into()), + code => Err(OrgsBlockUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Block a user from an organization + /// + /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// + /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn block_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 422 => Err(OrgsBlockUserError::Status422(github_response.to_json()?).into()), + code => Err(OrgsBlockUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Cancel an organization invitation + /// + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// + /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation) + /// + /// --- + pub async fn cancel_invitation_async(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCancelInvitationError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Cancel an organization invitation + /// + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// + /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn cancel_invitation(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "DELETE", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json()?).into()), + 404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCancelInvitationError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check if a user is blocked by an organization + /// + /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// + /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization) + /// + /// --- + pub async fn check_blocked_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCheckBlockedUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check if a user is blocked by an organization + /// + /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// + /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn check_blocked_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCheckBlockedUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check organization membership for a user + /// + /// Check if a user is, publicly or privately, a member of the organization. + /// + /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user) + /// + /// --- + pub async fn check_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 302 => Err(OrgsCheckMembershipForUserError::Status302.into()), + 404 => Err(OrgsCheckMembershipForUserError::Status404.into()), + code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check organization membership for a user + /// + /// Check if a user is, publicly or privately, a member of the organization. + /// + /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn check_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 302 => Err(OrgsCheckMembershipForUserError::Status302.into()), + 404 => Err(OrgsCheckMembershipForUserError::Status404.into()), + code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check public organization membership for a user + /// + /// Check if the provided user is a public member of the organization. + /// + /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user) + /// + /// --- + pub async fn check_public_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None::, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()), + code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Check public organization membership for a user + /// + /// Check if the provided user is a public member of the organization. + /// + /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn check_public_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + + let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: None, + method: "GET", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch(request)?; + + // -- + + if github_response.is_success() { + Ok(()) + } else { + match github_response.status_code() { + 404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()), + code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Convert an organization member to outside collaborator + /// + /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// + /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator) + /// + /// --- + pub async fn convert_member_to_outside_collaborator_async(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result, AdapterError> { + + let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username); + + + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "PUT", + headers: vec![] + }; + + let request = self.client.build(req)?; + + // -- + + let github_response = self.client.fetch_async(request).await?; + + // -- + + if github_response.is_success() { + Ok(github_response.to_json_async().await?) + } else { + match github_response.status_code() { + 204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()), + 403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()), + 404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()), + } + } + } + + /// --- + /// + /// # Convert an organization member to outside collaborator + /// + /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// + /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator) + /// + /// --- + #[cfg(not(target_arch = "wasm32"))] + pub fn convert_member_to_outside_collaborator(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result, AdapterError> { + + let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username); + - - pub fn redelivery(self, redelivery: bool) -> Self { - Self { - per_page: self.per_page, - cursor: self.cursor, - redelivery: Some(redelivery), - } - } -} + let req = GitHubRequest { + uri: request_uri, + body: Some(C::from_json::(body)?), + method: "PUT", + headers: vec![] + }; -/// Query parameters for the [List organization webhooks](Orgs::list_webhooks_async()) endpoint. -#[derive(Default, Serialize)] -pub struct OrgsListWebhooksParams { - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - per_page: Option, - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - page: Option -} + let request = self.client.build(req)?; -impl OrgsListWebhooksParams { - pub fn new() -> Self { - Self::default() - } + // -- - /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn per_page(self, per_page: u16) -> Self { - Self { - per_page: Some(per_page), - page: self.page, - } - } + let github_response = self.client.fetch(request)?; - /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" - pub fn page(self, page: u16) -> Self { - Self { - per_page: self.per_page, - page: Some(page), - } - } -} + // -- -impl<'enc> From<&'enc PerPage> for OrgsListWebhooksParams { - fn from(per_page: &'enc PerPage) -> Self { - Self { - per_page: Some(per_page.per_page), - page: Some(per_page.page), - ..Default::default() + if github_response.is_success() { + Ok(github_response.to_json()?) + } else { + match github_response.status_code() { + 204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()), + 403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()), + 404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json()?).into()), + code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()), + } } } -} -impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> { /// --- /// - /// # Add a security manager team + /// # Create an organization invitation /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// - /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team) + /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation) /// /// --- - pub async fn add_security_manager_team_async(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> { + pub async fn create_invitation_async(&self, org: &str, body: PostOrgsCreateInvitation) -> Result { - let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug); + let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None::, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3188,34 +4649,35 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()), + 422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCreateInvitationError::Generic { code }.into()), } } } /// --- /// - /// # Add a security manager team + /// # Create an organization invitation /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// - /// [GitHub API docs for add_security_manager_team](https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team) + /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn add_security_manager_team(&self, org: &str, team_slug: &str) -> Result<(), AdapterError> { + pub fn create_invitation(&self, org: &str, body: PostOrgsCreateInvitation) -> Result { - let request_uri = format!("{}/orgs/{}/security-managers/teams/{}", super::GITHUB_BASE_API_URL, org, team_slug); + let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3231,33 +4693,35 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - code => Err(OrgsAddSecurityManagerTeamError::Generic { code }.into()), + 422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json()?).into()), + 404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCreateInvitationError::Generic { code }.into()), } } } /// --- /// - /// # Assign an organization role to a team + /// # Create or update custom properties for an organization /// - /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Creates new or updates existing custom properties defined for an organization in a batch. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team) + /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization) /// /// --- - pub async fn assign_team_to_org_role_async(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> { + pub async fn create_or_update_custom_properties_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id); + let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None::, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "PATCH", headers: vec![] }; @@ -3273,36 +4737,36 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()), - 422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()), - code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()), } } } /// --- /// - /// # Assign an organization role to a team + /// # Create or update custom properties for an organization /// - /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Creates new or updates existing custom properties defined for an organization in a batch. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// [GitHub API docs for assign_team_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team) + /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn assign_team_to_org_role(&self, org: &str, team_slug: &str, role_id: i32) -> Result<(), AdapterError> { + pub fn create_or_update_custom_properties(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/organization-roles/teams/{}/{}", super::GITHUB_BASE_API_URL, org, team_slug, role_id); + let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "PATCH", headers: vec![] }; @@ -3318,35 +4782,40 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsAssignTeamToOrgRoleError::Status404.into()), - 422 => Err(OrgsAssignTeamToOrgRoleError::Status422.into()), - code => Err(OrgsAssignTeamToOrgRoleError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()), } } } /// --- /// - /// # Assign an organization role to a user + /// # Create or update custom property values for organization repositories /// - /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Create new or update existing custom property values for repositories in a batch that belong to an organization. + /// Each target repository will have its custom property values updated to match the values provided in the request. /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// A maximum of 30 repositories can be updated in a single request. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. + /// + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// - /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user) + /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories) /// /// --- - pub async fn assign_user_to_org_role_async(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> { + pub async fn create_or_update_custom_properties_values_for_repos_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id); + let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None::, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "PATCH", headers: vec![] }; @@ -3359,39 +4828,45 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { - 404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()), - 422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()), - code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json_async().await?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()), } } } /// --- /// - /// # Assign an organization role to a user + /// # Create or update custom property values for organization repositories /// - /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Create new or update existing custom property values for repositories in a batch that belong to an organization. + /// Each target repository will have its custom property values updated to match the values provided in the request. /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// A maximum of 30 repositories can be updated in a single request. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. + /// + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// - /// [GitHub API docs for assign_user_to_org_role](https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user) + /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn assign_user_to_org_role(&self, org: &str, username: &str, role_id: i32) -> Result<(), AdapterError> { + pub fn create_or_update_custom_properties_values_for_repos(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/organization-roles/users/{}/{}", super::GITHUB_BASE_API_URL, org, username, role_id); + let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None, - method: "PUT", + body: Some(C::from_json::(body)?), + method: "PATCH", headers: vec![] }; @@ -3404,33 +4879,38 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { - 404 => Err(OrgsAssignUserToOrgRoleError::Status404.into()), - 422 => Err(OrgsAssignUserToOrgRoleError::Status422.into()), - code => Err(OrgsAssignUserToOrgRoleError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json()?).into()), + 422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json()?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()), } } } /// --- /// - /// # Block a user from an organization + /// # Create or update a custom property for an organization /// - /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// Creates a new or updates an existing custom property that is defined for an organization. + /// + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization) + /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization) /// /// --- - pub async fn block_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub async fn create_or_update_custom_property_async(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result { - let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); let req = GitHubRequest { uri: request_uri, - body: None::, + body: Some(C::from_json::(body)?), method: "PUT", headers: vec![] }; @@ -3447,30 +4927,35 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 422 => Err(OrgsBlockUserError::Status422(github_response.to_json_async().await?).into()), - code => Err(OrgsBlockUserError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()), } } } /// --- /// - /// # Block a user from an organization + /// # Create or update a custom property for an organization /// - /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// Creates a new or updates an existing custom property that is defined for an organization. + /// + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// [GitHub API docs for block_user](https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization) + /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn block_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub fn create_or_update_custom_property(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result { - let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); let req = GitHubRequest { uri: request_uri, - body: None, + body: Some(C::from_json::(body)?), method: "PUT", headers: vec![] }; @@ -3487,32 +4972,36 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 422 => Err(OrgsBlockUserError::Status422(github_response.to_json()?).into()), - code => Err(OrgsBlockUserError::Generic { code }.into()), + 403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()), } } } /// --- /// - /// # Cancel an organization invitation + /// # Create an organization webhook /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Create a hook that posts payloads in JSON format. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or + /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation) + /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook) /// /// --- - pub async fn cancel_invitation_async(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> { + pub async fn create_webhook_async(&self, org: &str, body: PostOrgsCreateWebhook) -> Result { - let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id); + let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None::, - method: "DELETE", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3528,34 +5017,37 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCancelInvitationError::Generic { code }.into()), + 422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json_async().await?).into()), + 404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsCreateWebhookError::Generic { code }.into()), } } } /// --- /// - /// # Cancel an organization invitation + /// # Create an organization webhook /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Create a hook that posts payloads in JSON format. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or + /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// [GitHub API docs for cancel_invitation](https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation) + /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn cancel_invitation(&self, org: &str, invitation_id: i32) -> Result<(), AdapterError> { + pub fn create_webhook(&self, org: &str, body: PostOrgsCreateWebhook) -> Result { - let request_uri = format!("{}/orgs/{}/invitations/{}", super::GITHUB_BASE_API_URL, org, invitation_id); + let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: None, - method: "DELETE", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3571,31 +5063,37 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 422 => Err(OrgsCancelInvitationError::Status422(github_response.to_json()?).into()), - 404 => Err(OrgsCancelInvitationError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCancelInvitationError::Generic { code }.into()), + 422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json()?).into()), + 404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json()?).into()), + code => Err(OrgsCreateWebhookError::Generic { code }.into()), } } } /// --- /// - /// # Check if a user is blocked by an organization + /// # Delete an organization /// - /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// Deletes an organization and all its repositories. + /// + /// The organization login will be unavailable for 90 days after deletion. + /// + /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// + /// https://docs.github.com/site-policy/github-terms/github-terms-of-service /// - /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization) + /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization) /// /// --- - pub async fn check_blocked_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub async fn delete_async(&self, org: &str) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, body: None::, - method: "GET", + method: "DELETE", headers: vec![] }; @@ -3611,31 +5109,38 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCheckBlockedUserError::Generic { code }.into()), + 404 => Err(OrgsDeleteError::Status404(github_response.to_json_async().await?).into()), + 403 => Err(OrgsDeleteError::Status403(github_response.to_json_async().await?).into()), + code => Err(OrgsDeleteError::Generic { code }.into()), } } } /// --- /// - /// # Check if a user is blocked by an organization + /// # Delete an organization /// - /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// Deletes an organization and all its repositories. + /// + /// The organization login will be unavailable for 90 days after deletion. + /// + /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// + /// https://docs.github.com/site-policy/github-terms/github-terms-of-service /// - /// [GitHub API docs for check_blocked_user](https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization) + /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn check_blocked_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub fn delete(&self, org: &str) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/blocks/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, body: None, - method: "GET", + method: "DELETE", headers: vec![] }; @@ -3651,30 +5156,34 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsCheckBlockedUserError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCheckBlockedUserError::Generic { code }.into()), + 404 => Err(OrgsDeleteError::Status404(github_response.to_json()?).into()), + 403 => Err(OrgsDeleteError::Status403(github_response.to_json()?).into()), + code => Err(OrgsDeleteError::Generic { code }.into()), } } } /// --- /// - /// # Check organization membership for a user + /// # Delete an organization webhook /// - /// Check if a user is, publicly or privately, a member of the organization. + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user) + /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook) /// /// --- - pub async fn check_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub async fn delete_webhook_async(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id); let req = GitHubRequest { uri: request_uri, body: None::, - method: "GET", + method: "DELETE", headers: vec![] }; @@ -3687,35 +5196,37 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { - 302 => Err(OrgsCheckMembershipForUserError::Status302.into()), - 404 => Err(OrgsCheckMembershipForUserError::Status404.into()), - code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()), + 404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsDeleteWebhookError::Generic { code }.into()), } } } /// --- /// - /// # Check organization membership for a user + /// # Delete an organization webhook /// - /// Check if a user is, publicly or privately, a member of the organization. + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// [GitHub API docs for check_membership_for_user](https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user) + /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn check_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub fn delete_webhook(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/members/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id); let req = GitHubRequest { uri: request_uri, body: None, - method: "GET", + method: "DELETE", headers: vec![] }; @@ -3728,34 +5239,40 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { - 302 => Err(OrgsCheckMembershipForUserError::Status302.into()), - 404 => Err(OrgsCheckMembershipForUserError::Status404.into()), - code => Err(OrgsCheckMembershipForUserError::Generic { code }.into()), + 404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json()?).into()), + code => Err(OrgsDeleteWebhookError::Generic { code }.into()), } } } /// --- /// - /// # Check public organization membership for a user + /// # Enable or disable a security feature for an organization /// - /// Check if the provided user is a public member of the organization. + /// > [!WARNING] + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// + /// Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// - /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user) + /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization) /// /// --- - pub async fn check_public_membership_for_user_async(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub async fn enable_or_disable_security_product_on_all_org_repos_async(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement); let req = GitHubRequest { uri: request_uri, - body: None::, - method: "GET", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3768,34 +5285,41 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { - 404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()), - code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()), + 422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()), + code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()), } } } /// --- /// - /// # Check public organization membership for a user + /// # Enable or disable a security feature for an organization /// - /// Check if the provided user is a public member of the organization. + /// > [!WARNING] + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// + /// Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// - /// [GitHub API docs for check_public_membership_for_user](https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user) + /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn check_public_membership_for_user(&self, org: &str, username: &str) -> Result<(), AdapterError> { + pub fn enable_or_disable_security_product_on_all_org_repos(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> { - let request_uri = format!("{}/orgs/{}/public_members/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement); let req = GitHubRequest { uri: request_uri, - body: None, - method: "GET", + body: Some(C::from_json::(body)?), + method: "POST", headers: vec![] }; @@ -3808,33 +5332,41 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { - 404 => Err(OrgsCheckPublicMembershipForUserError::Status404.into()), - code => Err(OrgsCheckPublicMembershipForUserError::Generic { code }.into()), + 422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()), + code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()), } } } /// --- /// - /// # Convert an organization member to outside collaborator + /// # Get an organization /// - /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Gets information about an organization. + /// + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// + /// To see the full details about an organization, the authenticated user must be an organization owner. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. + /// + /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. /// - /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator) + /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization) /// /// --- - pub async fn convert_member_to_outside_collaborator_async(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result, AdapterError> { + pub async fn get_async(&self, org: &str) -> Result { - let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PUT", + body: None::, + method: "GET", headers: vec![] }; @@ -3850,33 +5382,39 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()), - 403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()), - 404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()), + 404 => Err(OrgsGetError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsGetError::Generic { code }.into()), } } } /// --- /// - /// # Convert an organization member to outside collaborator + /// # Get an organization /// - /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Gets information about an organization. + /// + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// + /// To see the full details about an organization, the authenticated user must be an organization owner. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. + /// + /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. /// - /// [GitHub API docs for convert_member_to_outside_collaborator](https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator) + /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn convert_member_to_outside_collaborator(&self, org: &str, username: &str, body: PutOrgsConvertMemberToOutsideCollaborator) -> Result, AdapterError> { + pub fn get(&self, org: &str) -> Result { - let request_uri = format!("{}/orgs/{}/outside_collaborators/{}", super::GITHUB_BASE_API_URL, org, username); + let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PUT", + body: None, + method: "GET", headers: vec![] }; @@ -3892,35 +5430,31 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 204 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status204.into()), - 403 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status403.into()), - 404 => Err(OrgsConvertMemberToOutsideCollaboratorError::Status404(github_response.to_json()?).into()), - code => Err(OrgsConvertMemberToOutsideCollaboratorError::Generic { code }.into()), + 404 => Err(OrgsGetError::Status404(github_response.to_json()?).into()), + code => Err(OrgsGetError::Generic { code }.into()), } } } /// --- /// - /// # Create an organization invitation - /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// # Get all custom properties for an organization /// - /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation) + /// Gets all custom properties defined for an organization. + /// Organization members can read these properties. + /// + /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization) /// /// --- - pub async fn create_invitation_async(&self, org: &str, body: PostOrgsCreateInvitation) -> Result { + pub async fn get_all_custom_properties_async(&self, org: &str) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None::, + method: "GET", headers: vec![] }; @@ -3936,35 +5470,33 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCreateInvitationError::Generic { code }.into()), + 403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()), } } } /// --- /// - /// # Create an organization invitation + /// # Get all custom properties for an organization /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Gets all custom properties defined for an organization. + /// Organization members can read these properties. /// - /// [GitHub API docs for create_invitation](https://docs.github.com/rest/orgs/members#create-an-organization-invitation) + /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn create_invitation(&self, org: &str, body: PostOrgsCreateInvitation) -> Result { + pub fn get_all_custom_properties(&self, org: &str) -> Result, AdapterError> { - let request_uri = format!("{}/orgs/{}/invitations", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None, + method: "GET", headers: vec![] }; @@ -3980,35 +5512,32 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 422 => Err(OrgsCreateInvitationError::Status422(github_response.to_json()?).into()), - 404 => Err(OrgsCreateInvitationError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCreateInvitationError::Generic { code }.into()), + 403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json()?).into()), + code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()), } } } /// --- /// - /// # Create or update custom properties for an organization + /// # Get a custom property for an organization /// - /// Creates new or updates existing custom properties defined for an organization in a batch. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// Gets a custom property that is defined for an organization. + /// Organization members can read these properties. /// - /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization) + /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization) /// /// --- - pub async fn create_or_update_custom_properties_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result, AdapterError> { + pub async fn get_custom_property_async(&self, org: &str, custom_property_name: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PATCH", + body: None::, + method: "GET", headers: vec![] }; @@ -4024,36 +5553,33 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()), + 403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsGetCustomPropertyError::Generic { code }.into()), } } } /// --- /// - /// # Create or update custom properties for an organization + /// # Get a custom property for an organization /// - /// Creates new or updates existing custom properties defined for an organization in a batch. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// Gets a custom property that is defined for an organization. + /// Organization members can read these properties. /// - /// [GitHub API docs for create_or_update_custom_properties](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization) + /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn create_or_update_custom_properties(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomProperties) -> Result, AdapterError> { + pub fn get_custom_property(&self, org: &str, custom_property_name: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PATCH", + body: None, + method: "GET", headers: vec![] }; @@ -4069,40 +5595,31 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertiesError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertiesError::Generic { code }.into()), + 403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json()?).into()), + code => Err(OrgsGetCustomPropertyError::Generic { code }.into()), } } } /// --- /// - /// # Create or update custom property values for organization repositories + /// # Get an organization membership for the authenticated user /// - /// Create new or update existing custom property values for repositories in a batch that belong to an organization. - /// Each target repository will have its custom property values updated to match the values provided in the request. - /// - /// A maximum of 30 repositories can be updated in a single request. - /// - /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. + /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. /// - /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories) + /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user) /// /// --- - pub async fn create_or_update_custom_properties_values_for_repos_async(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> { + pub async fn get_membership_for_authenticated_user_async(&self, org: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PATCH", + body: None::, + method: "GET", headers: vec![] }; @@ -4118,42 +5635,32 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json_async().await?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()), + 403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), + 404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), + code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()), } } } /// --- /// - /// # Create or update custom property values for organization repositories + /// # Get an organization membership for the authenticated user /// - /// Create new or update existing custom property values for repositories in a batch that belong to an organization. - /// Each target repository will have its custom property values updated to match the values provided in the request. - /// - /// A maximum of 30 repositories can be updated in a single request. - /// - /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. + /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. /// - /// [GitHub API docs for create_or_update_custom_properties_values_for_repos](https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories) + /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn create_or_update_custom_properties_values_for_repos(&self, org: &str, body: PatchOrgsCreateOrUpdateCustomPropertiesValuesForRepos) -> Result<(), AdapterError> { + pub fn get_membership_for_authenticated_user(&self, org: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/values", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PATCH", + body: None, + method: "GET", headers: vec![] }; @@ -4169,36 +5676,31 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status404(github_response.to_json()?).into()), - 422 => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Status422(github_response.to_json()?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertiesValuesForReposError::Generic { code }.into()), + 403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()), + 404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json()?).into()), + code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()), } } } /// --- /// - /// # Create or update a custom property for an organization + /// # Get organization membership for a user /// - /// Creates a new or updates an existing custom property that is defined for an organization. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. /// - /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization) + /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) /// /// --- - pub async fn create_or_update_custom_property_async(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result { + pub async fn get_membership_for_user_async(&self, org: &str, username: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); + let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PUT", + body: None::, + method: "GET", headers: vec![] }; @@ -4214,36 +5716,32 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()), + 404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json_async().await?).into()), + 403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json_async().await?).into()), + code => Err(OrgsGetMembershipForUserError::Generic { code }.into()), } } } /// --- /// - /// # Create or update a custom property for an organization + /// # Get organization membership for a user /// - /// Creates a new or updates an existing custom property that is defined for an organization. - /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. /// - /// [GitHub API docs for create_or_update_custom_property](https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization) + /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn create_or_update_custom_property(&self, org: &str, custom_property_name: &str, body: PutOrgsCreateOrUpdateCustomProperty) -> Result { + pub fn get_membership_for_user(&self, org: &str, username: &str) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); + let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "PUT", + body: None, + method: "GET", headers: vec![] }; @@ -4259,36 +5757,38 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsCreateOrUpdateCustomPropertyError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsCreateOrUpdateCustomPropertyError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCreateOrUpdateCustomPropertyError::Generic { code }.into()), + 404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json()?).into()), + 403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json()?).into()), + code => Err(OrgsGetMembershipForUserError::Generic { code }.into()), } } } /// --- /// - /// # Create an organization webhook + /// # Get an organization role /// - /// Create a hook that posts payloads in JSON format. + /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// You must be an organization owner to use this endpoint. + /// To use this endpoint, the authenticated user must be one of: /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or - /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook) + /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role) /// /// --- - pub async fn create_webhook_async(&self, org: &str, body: PostOrgsCreateWebhook) -> Result { + pub async fn get_org_role_async(&self, org: &str, role_id: i32) -> Result { - let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None::, + method: "GET", headers: vec![] }; @@ -4304,37 +5804,39 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json_async().await?).into()), - 404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsCreateWebhookError::Generic { code }.into()), + 404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json_async().await?).into()), + 422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json_async().await?).into()), + code => Err(OrgsGetOrgRoleError::Generic { code }.into()), } } } /// --- /// - /// # Create an organization webhook + /// # Get an organization role /// - /// Create a hook that posts payloads in JSON format. + /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// You must be an organization owner to use this endpoint. + /// To use this endpoint, the authenticated user must be one of: /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or - /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// [GitHub API docs for create_webhook](https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook) + /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn create_webhook(&self, org: &str, body: PostOrgsCreateWebhook) -> Result { + pub fn get_org_role(&self, org: &str, role_id: i32) -> Result { - let request_uri = format!("{}/orgs/{}/hooks", super::GITHUB_BASE_API_URL, org); + let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None, + method: "GET", headers: vec![] }; @@ -4349,38 +5851,34 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> if github_response.is_success() { Ok(github_response.to_json()?) } else { - match github_response.status_code() { - 422 => Err(OrgsCreateWebhookError::Status422(github_response.to_json()?).into()), - 404 => Err(OrgsCreateWebhookError::Status404(github_response.to_json()?).into()), - code => Err(OrgsCreateWebhookError::Generic { code }.into()), + match github_response.status_code() { + 404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json()?).into()), + 422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json()?).into()), + code => Err(OrgsGetOrgRoleError::Generic { code }.into()), } } } /// --- /// - /// # Delete an organization + /// # Get route stats by actor /// - /// Deletes an organization and all its repositories. - /// - /// The organization login will be unavailable for 90 days after deletion. - /// - /// Please review the Terms of Service regarding account deletion before using this endpoint: - /// - /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// Get API request count statistics for an actor broken down by route within a specified time frame. /// - /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization) + /// [GitHub API docs for get_route_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor) /// /// --- - pub async fn delete_async(&self, org: &str) -> Result, AdapterError> { + pub async fn get_route_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/route-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, body: None::, - method: "DELETE", + method: "GET", headers: vec![] }; @@ -4396,38 +5894,33 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsDeleteError::Status404(github_response.to_json_async().await?).into()), - 403 => Err(OrgsDeleteError::Status403(github_response.to_json_async().await?).into()), - code => Err(OrgsDeleteError::Generic { code }.into()), + code => Err(OrgsGetRouteStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Delete an organization + /// # Get route stats by actor /// - /// Deletes an organization and all its repositories. - /// - /// The organization login will be unavailable for 90 days after deletion. - /// - /// Please review the Terms of Service regarding account deletion before using this endpoint: - /// - /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// Get API request count statistics for an actor broken down by route within a specified time frame. /// - /// [GitHub API docs for delete](https://docs.github.com/rest/orgs/orgs#delete-an-organization) + /// [GitHub API docs for get_route_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn delete(&self, org: &str) -> Result, AdapterError> { + pub fn get_route_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/route-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + let qp: OrgsGetRouteStatsByActorParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, body: None, - method: "DELETE", + method: "GET", headers: vec![] }; @@ -4443,34 +5936,31 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsDeleteError::Status404(github_response.to_json()?).into()), - 403 => Err(OrgsDeleteError::Status403(github_response.to_json()?).into()), - code => Err(OrgsDeleteError::Generic { code }.into()), + code => Err(OrgsGetRouteStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Delete an organization webhook + /// # Get subject stats /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// - /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook) + /// [GitHub API docs for get_subject_stats](https://docs.github.com/rest/orgs/api-insights#get-subject-stats) /// /// --- - pub async fn delete_webhook_async(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> { + pub async fn get_subject_stats_async(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id); + let mut request_uri = format!("{}/orgs/{}/insights/api/subject-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, body: None::, - method: "DELETE", + method: "GET", headers: vec![] }; @@ -4486,34 +5976,33 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsDeleteWebhookError::Generic { code }.into()), + code => Err(OrgsGetSubjectStatsError::Generic { code }.into()), } } } /// --- /// - /// # Delete an organization webhook + /// # Get subject stats /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// - /// [GitHub API docs for delete_webhook](https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook) + /// [GitHub API docs for get_subject_stats](https://docs.github.com/rest/orgs/api-insights#get-subject-stats) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn delete_webhook(&self, org: &str, hook_id: i32) -> Result<(), AdapterError> { + pub fn get_subject_stats(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/hooks/{}", super::GITHUB_BASE_API_URL, org, hook_id); + let mut request_uri = format!("{}/orgs/{}/insights/api/subject-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + let qp: OrgsGetSubjectStatsParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, body: None, - method: "DELETE", + method: "GET", headers: vec![] }; @@ -4529,37 +6018,31 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsDeleteWebhookError::Status404(github_response.to_json()?).into()), - code => Err(OrgsDeleteWebhookError::Generic { code }.into()), + code => Err(OrgsGetSubjectStatsError::Generic { code }.into()), } } } /// --- /// - /// # Enable or disable a security feature for an organization + /// # Get summary stats /// - /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). - /// - /// Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// - /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization) + /// [GitHub API docs for get_summary_stats](https://docs.github.com/rest/orgs/api-insights#get-summary-stats) /// /// --- - pub async fn enable_or_disable_security_product_on_all_org_repos_async(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> { + pub async fn get_summary_stats_async(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None::, + method: "GET", headers: vec![] }; @@ -4575,38 +6058,33 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()), - code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsError::Generic { code }.into()), } } } /// --- /// - /// # Enable or disable a security feature for an organization + /// # Get summary stats /// - /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). - /// - /// Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// - /// [GitHub API docs for enable_or_disable_security_product_on_all_org_repos](https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization) + /// [GitHub API docs for get_summary_stats](https://docs.github.com/rest/orgs/api-insights#get-summary-stats) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn enable_or_disable_security_product_on_all_org_repos(&self, org: &str, security_product: &str, enablement: &str, body: PostOrgsEnableOrDisableSecurityProductOnAllOrgRepos) -> Result<(), AdapterError> { + pub fn get_summary_stats(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/{}/{}", super::GITHUB_BASE_API_URL, org, security_product, enablement); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + let qp: OrgsGetSummaryStatsParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, - body: Some(C::from_json::(body)?), - method: "POST", + body: None, + method: "GET", headers: vec![] }; @@ -4622,33 +6100,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 422 => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Status422.into()), - code => Err(OrgsEnableOrDisableSecurityProductOnAllOrgReposError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization + /// # Get summary stats by actor /// - /// Gets information about an organization. - /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). - /// - /// To see the full details about an organization, the authenticated user must be an organization owner. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. - /// - /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// - /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization) + /// [GitHub API docs for get_summary_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor) /// /// --- - pub async fn get_async(&self, org: &str) -> Result { + pub async fn get_summary_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -4669,34 +6140,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsGetError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsGetError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization + /// # Get summary stats by actor /// - /// Gets information about an organization. - /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). - /// - /// To see the full details about an organization, the authenticated user must be an organization owner. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. - /// - /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// - /// [GitHub API docs for get](https://docs.github.com/rest/orgs/orgs#get-an-organization) + /// [GitHub API docs for get_summary_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get(&self, org: &str) -> Result { + pub fn get_summary_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + let qp: OrgsGetSummaryStatsByActorParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -4717,26 +6182,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsGetError::Status404(github_response.to_json()?).into()), - code => Err(OrgsGetError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Get all custom properties for an organization + /// # Get summary stats by user /// - /// Gets all custom properties defined for an organization. - /// Organization members can read these properties. + /// Get overall statistics of API requests within the organization for a user. /// - /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization) + /// [GitHub API docs for get_summary_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user) /// /// --- - pub async fn get_all_custom_properties_async(&self, org: &str) -> Result, AdapterError> { + pub async fn get_summary_stats_by_user_async(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -4757,28 +6222,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsByUserError::Generic { code }.into()), } } } /// --- /// - /// # Get all custom properties for an organization + /// # Get summary stats by user /// - /// Gets all custom properties defined for an organization. - /// Organization members can read these properties. + /// Get overall statistics of API requests within the organization for a user. /// - /// [GitHub API docs for get_all_custom_properties](https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization) + /// [GitHub API docs for get_summary_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get_all_custom_properties(&self, org: &str) -> Result, AdapterError> { + pub fn get_summary_stats_by_user(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/summary-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + let qp: OrgsGetSummaryStatsByUserParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -4799,27 +6264,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsGetAllCustomPropertiesError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsGetAllCustomPropertiesError::Status404(github_response.to_json()?).into()), - code => Err(OrgsGetAllCustomPropertiesError::Generic { code }.into()), + code => Err(OrgsGetSummaryStatsByUserError::Generic { code }.into()), } } } /// --- /// - /// # Get a custom property for an organization + /// # Get time stats /// - /// Gets a custom property that is defined for an organization. - /// Organization members can read these properties. + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// - /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization) + /// [GitHub API docs for get_time_stats](https://docs.github.com/rest/orgs/api-insights#get-time-stats) /// /// --- - pub async fn get_custom_property_async(&self, org: &str, custom_property_name: &str) -> Result { + pub async fn get_time_stats_async(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -4840,28 +6304,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsGetCustomPropertyError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsError::Generic { code }.into()), } } } /// --- /// - /// # Get a custom property for an organization + /// # Get time stats /// - /// Gets a custom property that is defined for an organization. - /// Organization members can read these properties. + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// - /// [GitHub API docs for get_custom_property](https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization) + /// [GitHub API docs for get_time_stats](https://docs.github.com/rest/orgs/api-insights#get-time-stats) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get_custom_property(&self, org: &str, custom_property_name: &str) -> Result { + pub fn get_time_stats(&self, org: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/properties/schema/{}", super::GITHUB_BASE_API_URL, org, custom_property_name); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats", super::GITHUB_BASE_API_URL, org); + request_uri.push_str("?"); + let qp: OrgsGetTimeStatsParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -4882,26 +6346,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsGetCustomPropertyError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsGetCustomPropertyError::Status404(github_response.to_json()?).into()), - code => Err(OrgsGetCustomPropertyError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization membership for the authenticated user + /// # Get time stats by actor /// - /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user) + /// [GitHub API docs for get_time_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor) /// /// --- - pub async fn get_membership_for_authenticated_user_async(&self, org: &str) -> Result { + pub async fn get_time_stats_by_actor_async(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -4922,27 +6386,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), - 404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), - code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization membership for the authenticated user + /// # Get time stats by actor /// - /// If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// [GitHub API docs for get_membership_for_authenticated_user](https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user) + /// [GitHub API docs for get_time_stats_by_actor](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get_membership_for_authenticated_user(&self, org: &str) -> Result { + pub fn get_time_stats_by_actor(&self, org: &str, actor_type: &str, actor_id: i32, query_params: impl Into>) -> Result { - let request_uri = format!("{}/user/memberships/orgs/{}", super::GITHUB_BASE_API_URL, org); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/{}/{}", super::GITHUB_BASE_API_URL, org, actor_type, actor_id); + request_uri.push_str("?"); + let qp: OrgsGetTimeStatsByActorParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -4963,26 +6428,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 403 => Err(OrgsGetMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()), - 404 => Err(OrgsGetMembershipForAuthenticatedUserError::Status404(github_response.to_json()?).into()), - code => Err(OrgsGetMembershipForAuthenticatedUserError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsByActorError::Generic { code }.into()), } } } /// --- /// - /// # Get organization membership for a user + /// # Get time stats by user /// - /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) + /// [GitHub API docs for get_time_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user) /// /// --- - pub async fn get_membership_for_user_async(&self, org: &str, username: &str) -> Result { + pub async fn get_time_stats_by_user_async(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -5003,27 +6468,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json_async().await?).into()), - 403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json_async().await?).into()), - code => Err(OrgsGetMembershipForUserError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsByUserError::Generic { code }.into()), } } } /// --- /// - /// # Get organization membership for a user + /// # Get time stats by user /// - /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// [GitHub API docs for get_membership_for_user](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) + /// [GitHub API docs for get_time_stats_by_user](https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get_membership_for_user(&self, org: &str, username: &str) -> Result { + pub fn get_time_stats_by_user(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/memberships/{}", super::GITHUB_BASE_API_URL, org, username); + let mut request_uri = format!("{}/orgs/{}/insights/api/time-stats/users/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + let qp: OrgsGetTimeStatsByUserParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -5044,33 +6510,26 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsGetMembershipForUserError::Status404(github_response.to_json()?).into()), - 403 => Err(OrgsGetMembershipForUserError::Status403(github_response.to_json()?).into()), - code => Err(OrgsGetMembershipForUserError::Generic { code }.into()), + code => Err(OrgsGetTimeStatsByUserError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization role + /// # Get user stats /// - /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// To use this endpoint, the authenticated user must be one of: - /// - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get API usage statistics within an organization for a user broken down by the type of access. /// - /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role) + /// [GitHub API docs for get_user_stats](https://docs.github.com/rest/orgs/api-insights#get-user-stats) /// /// --- - pub async fn get_org_role_async(&self, org: &str, role_id: i32) -> Result { + pub async fn get_user_stats_async(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id); + let mut request_uri = format!("{}/orgs/{}/insights/api/user-stats/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + request_uri.push_str(&serde_urlencoded::to_string(query_params.into())?); let req = GitHubRequest { uri: request_uri, @@ -5091,34 +6550,28 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json_async().await?) } else { match github_response.status_code() { - 404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json_async().await?).into()), - 422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json_async().await?).into()), - code => Err(OrgsGetOrgRoleError::Generic { code }.into()), + code => Err(OrgsGetUserStatsError::Generic { code }.into()), } } } /// --- /// - /// # Get an organization role + /// # Get user stats /// - /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// To use this endpoint, the authenticated user must be one of: - /// - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get API usage statistics within an organization for a user broken down by the type of access. /// - /// [GitHub API docs for get_org_role](https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role) + /// [GitHub API docs for get_user_stats](https://docs.github.com/rest/orgs/api-insights#get-user-stats) /// /// --- #[cfg(not(target_arch = "wasm32"))] - pub fn get_org_role(&self, org: &str, role_id: i32) -> Result { + pub fn get_user_stats(&self, org: &str, user_id: &str, query_params: impl Into>) -> Result { - let request_uri = format!("{}/orgs/{}/organization-roles/{}", super::GITHUB_BASE_API_URL, org, role_id); + let mut request_uri = format!("{}/orgs/{}/insights/api/user-stats/{}", super::GITHUB_BASE_API_URL, org, user_id); + request_uri.push_str("?"); + let qp: OrgsGetUserStatsParams = query_params.into(); + request_uri.push_str(&serde_urlencoded::to_string(qp)?); let req = GitHubRequest { uri: request_uri, @@ -5139,9 +6592,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> Ok(github_response.to_json()?) } else { match github_response.status_code() { - 404 => Err(OrgsGetOrgRoleError::Status404(github_response.to_json()?).into()), - 422 => Err(OrgsGetOrgRoleError::Status422(github_response.to_json()?).into()), - code => Err(OrgsGetOrgRoleError::Generic { code }.into()), + code => Err(OrgsGetUserStatsError::Generic { code }.into()), } } } @@ -5972,6 +7423,9 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> /// List organizations for the authenticated user. /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. + /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. /// /// [GitHub API docs for list_for_authenticated_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) /// @@ -6019,6 +7473,9 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> /// List organizations for the authenticated user. /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. + /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. /// /// [GitHub API docs for list_for_authenticated_user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) /// @@ -7681,7 +9138,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(OrgsPingWebhookError::Status404(github_response.to_json_async().await?).into()), @@ -7727,7 +9184,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(OrgsPingWebhookError::Status404(github_response.to_json()?).into()), @@ -7861,7 +9318,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveCustomPropertyError::Status403(github_response.to_json_async().await?).into()), @@ -7906,7 +9363,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveCustomPropertyError::Status403(github_response.to_json()?).into()), @@ -7946,7 +9403,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveMemberError::Status403(github_response.to_json_async().await?).into()), @@ -7986,7 +9443,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveMemberError::Status403(github_response.to_json()?).into()), @@ -8027,7 +9484,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveMembershipForUserError::Status403(github_response.to_json_async().await?).into()), @@ -8070,7 +9527,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsRemoveMembershipForUserError::Status403(github_response.to_json()?).into()), @@ -8110,7 +9567,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(OrgsRemoveOutsideCollaboratorError::Status422(github_response.to_json_async().await?).into()), @@ -8150,7 +9607,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(OrgsRemoveOutsideCollaboratorError::Status422(github_response.to_json()?).into()), @@ -8189,7 +9646,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRemovePublicMembershipForAuthenticatedUserError::Generic { code }.into()), @@ -8228,7 +9685,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRemovePublicMembershipForAuthenticatedUserError::Generic { code }.into()), @@ -8270,7 +9727,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRemoveSecurityManagerTeamError::Generic { code }.into()), @@ -8313,7 +9770,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRemoveSecurityManagerTeamError::Generic { code }.into()), @@ -8353,7 +9810,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 500 => Err(OrgsReviewPatGrantRequestError::Status500(github_response.to_json_async().await?).into()), @@ -8398,7 +9855,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 500 => Err(OrgsReviewPatGrantRequestError::Status500(github_response.to_json()?).into()), @@ -8533,7 +9990,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeAllOrgRolesTeamError::Generic { code }.into()), @@ -8576,7 +10033,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeAllOrgRolesTeamError::Generic { code }.into()), @@ -8618,7 +10075,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeAllOrgRolesUserError::Generic { code }.into()), @@ -8661,7 +10118,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeAllOrgRolesUserError::Generic { code }.into()), @@ -8703,7 +10160,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeOrgRoleTeamError::Generic { code }.into()), @@ -8746,7 +10203,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeOrgRoleTeamError::Generic { code }.into()), @@ -8788,7 +10245,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeOrgRoleUserError::Generic { code }.into()), @@ -8831,7 +10288,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsRevokeOrgRoleUserError::Generic { code }.into()), @@ -8968,7 +10425,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), @@ -9010,7 +10467,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(OrgsSetPublicMembershipForAuthenticatedUserError::Status403(github_response.to_json()?).into()), @@ -9049,7 +10506,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsUnblockUserError::Generic { code }.into()), @@ -9088,7 +10545,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(OrgsUnblockUserError::Generic { code }.into()), @@ -9101,10 +10558,10 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> /// # Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -9151,10 +10608,10 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> /// # Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -9312,7 +10769,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 500 => Err(OrgsUpdatePatAccessError::Status500(github_response.to_json_async().await?).into()), @@ -9357,7 +10814,7 @@ impl<'api, C: Client> Orgs<'api, C> where AdapterError: From<::Err> // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 500 => Err(OrgsUpdatePatAccessError::Status500(github_response.to_json()?).into()), diff --git a/src/endpoints/packages.rs b/src/endpoints/packages.rs index 2073a49..0954311 100644 --- a/src/endpoints/packages.rs +++ b/src/endpoints/packages.rs @@ -1144,7 +1144,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user) /// @@ -1170,7 +1170,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -1187,7 +1187,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user) /// @@ -1214,7 +1214,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -1233,7 +1233,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_org](https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization) /// @@ -1259,7 +1259,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -1278,7 +1278,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_org](https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization) /// @@ -1305,7 +1305,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForOrgError::Status404(github_response.to_json()?).into()), @@ -1324,7 +1324,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_user](https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user) /// @@ -1350,7 +1350,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForUserError::Status404(github_response.to_json_async().await?).into()), @@ -1369,7 +1369,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_for_user](https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user) /// @@ -1396,7 +1396,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageForUserError::Status404(github_response.to_json()?).into()), @@ -1415,7 +1415,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user) /// @@ -1441,7 +1441,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -1460,7 +1460,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user) /// @@ -1487,7 +1487,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -1506,7 +1506,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_org](https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization) /// @@ -1532,7 +1532,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -1551,7 +1551,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_org](https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization) /// @@ -1578,7 +1578,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForOrgError::Status404(github_response.to_json()?).into()), @@ -1597,7 +1597,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_user](https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user) /// @@ -1623,7 +1623,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForUserError::Status404(github_response.to_json_async().await?).into()), @@ -1642,7 +1642,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for delete_package_version_for_user](https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user) /// @@ -1669,7 +1669,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesDeletePackageVersionForUserError::Status404(github_response.to_json()?).into()), @@ -1686,7 +1686,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_authenticated_user](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user) /// @@ -1733,7 +1733,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_authenticated_user](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user) /// @@ -1782,7 +1782,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_org](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization) /// @@ -1829,7 +1829,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_org](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization) /// @@ -1878,7 +1878,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_user](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user) /// @@ -1921,7 +1921,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_all_package_versions_for_package_owned_by_user](https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user) /// @@ -1965,7 +1965,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user) /// @@ -2005,7 +2005,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user) /// @@ -2046,7 +2046,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_organization](https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization) /// @@ -2086,7 +2086,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_organization](https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization) /// @@ -2127,7 +2127,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_user](https://docs.github.com/rest/packages/packages#get-a-package-for-a-user) /// @@ -2167,7 +2167,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_for_user](https://docs.github.com/rest/packages/packages#get-a-package-for-a-user) /// @@ -2208,7 +2208,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user) /// @@ -2248,7 +2248,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user) /// @@ -2289,7 +2289,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_organization](https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization) /// @@ -2329,7 +2329,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_organization](https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization) /// @@ -2370,7 +2370,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_user](https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user) /// @@ -2410,7 +2410,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for get_package_version_for_user](https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user) /// @@ -2702,7 +2702,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_authenticated_user](https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace) /// @@ -2745,7 +2745,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_authenticated_user](https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace) /// @@ -2790,7 +2790,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_organization](https://docs.github.com/rest/packages/packages#list-packages-for-an-organization) /// @@ -2835,7 +2835,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_organization](https://docs.github.com/rest/packages/packages#list-packages-for-an-organization) /// @@ -2882,7 +2882,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_user](https://docs.github.com/rest/packages/packages#list-packages-for-a-user) /// @@ -2927,7 +2927,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for list_packages_for_user](https://docs.github.com/rest/packages/packages#list-packages-for-a-user) /// @@ -2978,7 +2978,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user) /// @@ -3008,7 +3008,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -3029,7 +3029,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_authenticated_user](https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user) /// @@ -3061,7 +3061,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -3084,7 +3084,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_org](https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization) /// @@ -3114,7 +3114,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -3137,7 +3137,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_org](https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization) /// @@ -3169,7 +3169,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForOrgError::Status404(github_response.to_json()?).into()), @@ -3192,7 +3192,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_user](https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user) /// @@ -3222,7 +3222,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForUserError::Status404(github_response.to_json_async().await?).into()), @@ -3245,7 +3245,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_for_user](https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user) /// @@ -3277,7 +3277,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageForUserError::Status404(github_response.to_json()?).into()), @@ -3298,7 +3298,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user) /// @@ -3324,7 +3324,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -3345,7 +3345,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_authenticated_user](https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user) /// @@ -3372,7 +3372,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -3395,7 +3395,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_org](https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization) /// @@ -3421,7 +3421,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForOrgError::Status404(github_response.to_json_async().await?).into()), @@ -3444,7 +3444,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_org](https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization) /// @@ -3471,7 +3471,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForOrgError::Status404(github_response.to_json()?).into()), @@ -3494,7 +3494,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_user](https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user) /// @@ -3520,7 +3520,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForUserError::Status404(github_response.to_json_async().await?).into()), @@ -3543,7 +3543,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// [GitHub API docs for restore_package_version_for_user](https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user) /// @@ -3570,7 +3570,7 @@ impl<'api, C: Client> Packages<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PackagesRestorePackageVersionForUserError::Status404(github_response.to_json()?).into()), diff --git a/src/endpoints/projects.rs b/src/endpoints/projects.rs index 61c1428..4fdccaf 100644 --- a/src/endpoints/projects.rs +++ b/src/endpoints/projects.rs @@ -1199,7 +1199,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ProjectsAddCollaboratorError::Status404(github_response.to_json_async().await?).into()), @@ -1243,7 +1243,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ProjectsAddCollaboratorError::Status404(github_response.to_json()?).into()), @@ -1713,7 +1713,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteError::Status304.into()), @@ -1757,7 +1757,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteError::Status304.into()), @@ -1800,7 +1800,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteCardError::Status304.into()), @@ -1843,7 +1843,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteCardError::Status304.into()), @@ -1885,7 +1885,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteColumnError::Status304.into()), @@ -1927,7 +1927,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsDeleteColumnError::Status304.into()), @@ -3024,7 +3024,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsRemoveCollaboratorError::Status304.into()), @@ -3068,7 +3068,7 @@ impl<'api, C: Client> Projects<'api, C> where AdapterError: From<:: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(ProjectsRemoveCollaboratorError::Status304.into()), diff --git a/src/endpoints/pulls.rs b/src/endpoints/pulls.rs index 637a512..188f157 100644 --- a/src/endpoints/pulls.rs +++ b/src/endpoints/pulls.rs @@ -1211,7 +1211,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PullsCheckIfMergedError::Status404.into()), @@ -1251,7 +1251,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PullsCheckIfMergedError::Status404.into()), @@ -1583,7 +1583,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -1637,7 +1637,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -1809,7 +1809,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PullsDeleteReviewCommentError::Status404(github_response.to_json_async().await?).into()), @@ -1849,7 +1849,7 @@ impl<'api, C: Client> Pulls<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(PullsDeleteReviewCommentError::Status404(github_response.to_json()?).into()), diff --git a/src/endpoints/rate_limit.rs b/src/endpoints/rate_limit.rs index f8e3647..d9668d5 100644 --- a/src/endpoints/rate_limit.rs +++ b/src/endpoints/rate_limit.rs @@ -79,7 +79,7 @@ impl<'api, C: Client> RateLimit<'api, C> where AdapterError: From<: /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// [GitHub API docs for get](https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user) /// @@ -134,7 +134,7 @@ impl<'api, C: Client> RateLimit<'api, C> where AdapterError: From<: /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// [GitHub API docs for get](https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user) /// diff --git a/src/endpoints/reactions.rs b/src/endpoints/reactions.rs index 0120f31..b907880 100644 --- a/src/endpoints/reactions.rs +++ b/src/endpoints/reactions.rs @@ -1592,7 +1592,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -1637,7 +1637,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -1776,7 +1776,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -1821,7 +1821,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -1895,7 +1895,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForCommitCommentError::Generic { code }.into()), @@ -1937,7 +1937,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForCommitCommentError::Generic { code }.into()), @@ -1978,7 +1978,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForIssueError::Generic { code }.into()), @@ -2020,7 +2020,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForIssueError::Generic { code }.into()), @@ -2061,7 +2061,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForIssueCommentError::Generic { code }.into()), @@ -2103,7 +2103,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForIssueCommentError::Generic { code }.into()), @@ -2144,7 +2144,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForPullRequestCommentError::Generic { code }.into()), @@ -2186,7 +2186,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForPullRequestCommentError::Generic { code }.into()), @@ -2227,7 +2227,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForReleaseError::Generic { code }.into()), @@ -2269,7 +2269,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForReleaseError::Generic { code }.into()), @@ -2312,7 +2312,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForTeamDiscussionError::Generic { code }.into()), @@ -2356,7 +2356,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForTeamDiscussionError::Generic { code }.into()), @@ -2399,7 +2399,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForTeamDiscussionCommentError::Generic { code }.into()), @@ -2443,7 +2443,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReactionsDeleteForTeamDiscussionCommentError::Generic { code }.into()), @@ -2994,7 +2994,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -3041,7 +3041,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -3186,7 +3186,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -3233,7 +3233,7 @@ impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<: /// # List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// diff --git a/src/endpoints/repos.rs b/src/endpoints/repos.rs index 2926f31..b14757b 100644 --- a/src/endpoints/repos.rs +++ b/src/endpoints/repos.rs @@ -969,7 +969,7 @@ impl From for AdapterError { } } -/// Errors for the [Deprecated - Create a tag protection state for a repository](Repos::create_tag_protection_async()) endpoint. +/// Errors for the [Closing down - Create a tag protection state for a repository](Repos::create_tag_protection_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum ReposCreateTagProtectionError { #[error("Forbidden")] @@ -1545,7 +1545,7 @@ impl From for AdapterError { } } -/// Errors for the [Deprecated - Delete a tag protection state for a repository](Repos::delete_tag_protection_async()) endpoint. +/// Errors for the [Closing down - Delete a tag protection state for a repository](Repos::delete_tag_protection_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum ReposDeleteTagProtectionError { #[error("Forbidden")] @@ -4008,7 +4008,7 @@ impl From for AdapterError { } } -/// Errors for the [Deprecated - List tag protection states for a repository](Repos::list_tag_protection_async()) endpoint. +/// Errors for the [Closing down - List tag protection states for a repository](Repos::list_tag_protection_async()) endpoint. #[derive(Debug, thiserror::Error)] pub enum ReposListTagProtectionError { #[error("Forbidden")] @@ -7378,9 +7378,7 @@ pub struct ReposListWebhookDeliveriesParams<'req> { /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - cursor: Option<&'req str>, - - redelivery: Option + cursor: Option<&'req str> } impl<'req> ReposListWebhookDeliveriesParams<'req> { @@ -7393,7 +7391,6 @@ impl<'req> ReposListWebhookDeliveriesParams<'req> { Self { per_page: Some(per_page), cursor: self.cursor, - redelivery: self.redelivery, } } @@ -7402,16 +7399,6 @@ impl<'req> ReposListWebhookDeliveriesParams<'req> { Self { per_page: self.per_page, cursor: Some(cursor), - redelivery: self.redelivery, - } - } - - - pub fn redelivery(self, redelivery: bool) -> Self { - Self { - per_page: self.per_page, - cursor: self.cursor, - redelivery: Some(redelivery), } } } @@ -7517,7 +7504,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposAcceptInvitationForAuthenticatedUserError::Status403(github_response.to_json_async().await?).into()), @@ -7558,7 +7545,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposAcceptInvitationForAuthenticatedUserError::Status403(github_response.to_json()?).into()), @@ -8065,7 +8052,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCancelPagesDeploymentError::Status404(github_response.to_json_async().await?).into()), @@ -8107,7 +8094,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCancelPagesDeploymentError::Status404(github_response.to_json()?).into()), @@ -8231,7 +8218,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCheckCollaboratorError::Status404.into()), @@ -8277,7 +8264,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCheckCollaboratorError::Status404.into()), @@ -8395,7 +8382,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCheckVulnerabilityAlertsError::Status404.into()), @@ -8435,7 +8422,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCheckVulnerabilityAlertsError::Status404.into()), @@ -9710,7 +9697,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCreateDispatchEventError::Status404(github_response.to_json_async().await?).into()), @@ -9757,7 +9744,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposCreateDispatchEventError::Status404(github_response.to_json()?).into()), @@ -10075,7 +10062,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposCreateOrUpdateCustomPropertiesValuesError::Status403(github_response.to_json_async().await?).into()), @@ -10120,7 +10107,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposCreateOrUpdateCustomPropertiesValuesError::Status403(github_response.to_json()?).into()), @@ -10746,15 +10733,15 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - Create a tag protection state for a repository + /// # Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. /// - /// [GitHub API docs for create_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository) + /// [GitHub API docs for create_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository) /// /// --- pub async fn create_tag_protection_async(&self, owner: &str, repo: &str, body: PostReposCreateTagProtection) -> Result { @@ -10790,15 +10777,15 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - Create a tag protection state for a repository + /// # Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. /// - /// [GitHub API docs for create_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository) + /// [GitHub API docs for create_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository) /// /// --- #[cfg(not(target_arch = "wasm32"))] @@ -11027,7 +11014,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ReposDeclineInvitationForAuthenticatedUserError::Status409(github_response.to_json_async().await?).into()), @@ -11068,7 +11055,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 409 => Err(ReposDeclineInvitationForAuthenticatedUserError::Status409(github_response.to_json()?).into()), @@ -11115,7 +11102,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteError::Status403(github_response.to_json_async().await?).into()), @@ -11162,7 +11149,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteError::Status403(github_response.to_json()?).into()), @@ -11205,7 +11192,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteAccessRestrictionsError::Generic { code }.into()), @@ -11246,7 +11233,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteAccessRestrictionsError::Generic { code }.into()), @@ -11286,7 +11273,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteAdminBranchProtectionError::Status404(github_response.to_json_async().await?).into()), @@ -11328,7 +11315,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteAdminBranchProtectionError::Status404(github_response.to_json()?).into()), @@ -11367,7 +11354,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteAnEnvironmentError::Generic { code }.into()), @@ -11406,7 +11393,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteAnEnvironmentError::Generic { code }.into()), @@ -11446,7 +11433,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteAutolinkError::Status404(github_response.to_json_async().await?).into()), @@ -11488,7 +11475,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteAutolinkError::Status404(github_response.to_json()?).into()), @@ -11527,7 +11514,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteBranchProtectionError::Status403(github_response.to_json_async().await?).into()), @@ -11567,7 +11554,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteBranchProtectionError::Status403(github_response.to_json()?).into()), @@ -11604,7 +11591,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteCommitCommentError::Status404(github_response.to_json_async().await?).into()), @@ -11642,7 +11629,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteCommitCommentError::Status404(github_response.to_json()?).into()), @@ -11683,7 +11670,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteCommitSignatureProtectionError::Status404(github_response.to_json_async().await?).into()), @@ -11725,7 +11712,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteCommitSignatureProtectionError::Status404(github_response.to_json()?).into()), @@ -11764,7 +11751,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteDeployKeyError::Generic { code }.into()), @@ -11803,7 +11790,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteDeployKeyError::Generic { code }.into()), @@ -11850,7 +11837,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteDeploymentError::Status404(github_response.to_json_async().await?).into()), @@ -11900,7 +11887,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteDeploymentError::Status404(github_response.to_json()?).into()), @@ -11942,7 +11929,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteDeploymentBranchPolicyError::Generic { code }.into()), @@ -11983,7 +11970,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteDeploymentBranchPolicyError::Generic { code }.into()), @@ -12122,7 +12109,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteInvitationError::Generic { code }.into()), @@ -12159,7 +12146,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteInvitationError::Generic { code }.into()), @@ -12197,7 +12184,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteOrgRulesetError::Status404(github_response.to_json_async().await?).into()), @@ -12238,7 +12225,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteOrgRulesetError::Status404(github_response.to_json()?).into()), @@ -12282,7 +12269,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposDeletePagesSiteError::Status422(github_response.to_json_async().await?).into()), @@ -12328,7 +12315,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposDeletePagesSiteError::Status422(github_response.to_json()?).into()), @@ -12369,7 +12356,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeletePullRequestReviewProtectionError::Status404(github_response.to_json_async().await?).into()), @@ -12409,7 +12396,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeletePullRequestReviewProtectionError::Status404(github_response.to_json()?).into()), @@ -12448,7 +12435,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteReleaseError::Generic { code }.into()), @@ -12487,7 +12474,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteReleaseError::Generic { code }.into()), @@ -12523,7 +12510,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteReleaseAssetError::Generic { code }.into()), @@ -12560,7 +12547,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDeleteReleaseAssetError::Generic { code }.into()), @@ -12598,7 +12585,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteRepoRulesetError::Status404(github_response.to_json_async().await?).into()), @@ -12639,7 +12626,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteRepoRulesetError::Status404(github_response.to_json()?).into()), @@ -12651,15 +12638,15 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - Delete a tag protection state for a repository + /// # Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. /// - /// [GitHub API docs for delete_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository) + /// [GitHub API docs for delete_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository) /// /// --- pub async fn delete_tag_protection_async(&self, owner: &str, repo: &str, tag_protection_id: i32) -> Result<(), AdapterError> { @@ -12683,7 +12670,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteTagProtectionError::Status403(github_response.to_json_async().await?).into()), @@ -12695,15 +12682,15 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - Delete a tag protection state for a repository + /// # Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. /// - /// [GitHub API docs for delete_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository) + /// [GitHub API docs for delete_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository) /// /// --- #[cfg(not(target_arch = "wasm32"))] @@ -12728,7 +12715,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(ReposDeleteTagProtectionError::Status403(github_response.to_json()?).into()), @@ -12766,7 +12753,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteWebhookError::Status404(github_response.to_json_async().await?).into()), @@ -12804,7 +12791,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposDeleteWebhookError::Status404(github_response.to_json()?).into()), @@ -12843,7 +12830,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableAutomatedSecurityFixesError::Generic { code }.into()), @@ -12882,7 +12869,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableAutomatedSecurityFixesError::Generic { code }.into()), @@ -12924,7 +12911,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableDeploymentProtectionRuleError::Generic { code }.into()), @@ -12967,7 +12954,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableDeploymentProtectionRuleError::Generic { code }.into()), @@ -13005,7 +12992,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposDisablePrivateVulnerabilityReportingError::Status422(github_response.to_json_async().await?).into()), @@ -13045,7 +13032,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposDisablePrivateVulnerabilityReportingError::Status422(github_response.to_json()?).into()), @@ -13086,7 +13073,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableVulnerabilityAlertsError::Generic { code }.into()), @@ -13127,7 +13114,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposDisableVulnerabilityAlertsError::Generic { code }.into()), @@ -13170,7 +13157,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ReposDownloadTarballArchiveError::Status302.into()), @@ -13215,7 +13202,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ReposDownloadTarballArchiveError::Status302.into()), @@ -13259,7 +13246,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ReposDownloadZipballArchiveError::Status302.into()), @@ -13304,7 +13291,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 302 => Err(ReposDownloadZipballArchiveError::Status302.into()), @@ -13343,7 +13330,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposEnableAutomatedSecurityFixesError::Generic { code }.into()), @@ -13382,7 +13369,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposEnableAutomatedSecurityFixesError::Generic { code }.into()), @@ -13420,7 +13407,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposEnablePrivateVulnerabilityReportingError::Status422(github_response.to_json_async().await?).into()), @@ -13460,7 +13447,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposEnablePrivateVulnerabilityReportingError::Status422(github_response.to_json()?).into()), @@ -13499,7 +13486,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposEnableVulnerabilityAlertsError::Generic { code }.into()), @@ -13538,7 +13525,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposEnableVulnerabilityAlertsError::Generic { code }.into()), @@ -21602,16 +21589,16 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - List tag protection states for a repository + /// # Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// /// This information is only available to repository administrators. /// - /// [GitHub API docs for list_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository) + /// [GitHub API docs for list_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository) /// /// --- pub async fn list_tag_protection_async(&self, owner: &str, repo: &str) -> Result, AdapterError> { @@ -21647,16 +21634,16 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err /// --- /// - /// # Deprecated - List tag protection states for a repository + /// # Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// /// This information is only available to repository administrators. /// - /// [GitHub API docs for list_tag_protection](https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository) + /// [GitHub API docs for list_tag_protection](https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository) /// /// --- #[cfg(not(target_arch = "wasm32"))] @@ -22241,7 +22228,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposPingWebhookError::Status404(github_response.to_json_async().await?).into()), @@ -22281,7 +22268,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposPingWebhookError::Status404(github_response.to_json()?).into()), @@ -22505,7 +22492,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposRemoveCollaboratorError::Status422(github_response.to_json_async().await?).into()), @@ -22567,7 +22554,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposRemoveCollaboratorError::Status422(github_response.to_json()?).into()), @@ -22688,7 +22675,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposRemoveStatusCheckProtectionError::Generic { code }.into()), @@ -22727,7 +22714,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(ReposRemoveStatusCheckProtectionError::Generic { code }.into()), @@ -23616,7 +23603,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposTestPushWebhookError::Status404(github_response.to_json_async().await?).into()), @@ -23659,7 +23646,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(ReposTestPushWebhookError::Status404(github_response.to_json()?).into()), @@ -24137,7 +24124,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposUpdateInformationAboutPagesSiteError::Status422(github_response.to_json_async().await?).into()), @@ -24183,7 +24170,7 @@ impl<'api, C: Client> Repos<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(ReposUpdateInformationAboutPagesSiteError::Status422(github_response.to_json()?).into()), diff --git a/src/endpoints/search.rs b/src/endpoints/search.rs index f76f840..a2122d9 100644 --- a/src/endpoints/search.rs +++ b/src/endpoints/search.rs @@ -243,9 +243,9 @@ impl From for AdapterError { pub struct SearchCodeParams<'req> { /// The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See \"[Searching code](https://docs.github.com/search-github/searching-on-github/searching-code)\" for a detailed list of qualifiers. q: &'req str, - /// **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + /// **This field is closing down.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) sort: Option<&'req str>, - /// **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + /// **This field is closing down.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. order: Option<&'req str>, /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" per_page: Option, @@ -269,7 +269,7 @@ impl<'req> SearchCodeParams<'req> { } } - /// **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + /// **This field is closing down.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) pub fn sort(self, sort: &'req str) -> Self { Self { q: self.q, @@ -280,7 +280,7 @@ impl<'req> SearchCodeParams<'req> { } } - /// **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + /// **This field is closing down.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. pub fn order(self, order: &'req str) -> Self { Self { q: self.q, diff --git a/src/endpoints/secret_scanning.rs b/src/endpoints/secret_scanning.rs index a1d23c0..fa16058 100644 --- a/src/endpoints/secret_scanning.rs +++ b/src/endpoints/secret_scanning.rs @@ -255,7 +255,11 @@ pub struct SecretScanningListAlertsForEnterpriseParams<'req> { /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\" after: Option<&'req str>, /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - validity: Option<&'req str> + validity: Option<&'req str>, + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + is_publicly_leaked: Option, + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + is_multi_repo: Option } impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { @@ -275,6 +279,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -290,6 +296,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -305,6 +313,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -320,6 +330,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -335,6 +347,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -350,6 +364,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -365,6 +381,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: Some(before), after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -380,6 +398,8 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: Some(after), validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -395,6 +415,42 @@ impl<'req> SecretScanningListAlertsForEnterpriseParams<'req> { before: self.before, after: self.after, validity: Some(validity), + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + pub fn is_publicly_leaked(self, is_publicly_leaked: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: Some(is_publicly_leaked), + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + pub fn is_multi_repo(self, is_multi_repo: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: Some(is_multi_repo), } } } @@ -421,7 +477,11 @@ pub struct SecretScanningListAlertsForOrgParams<'req> { /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty \"after\" query string. after: Option<&'req str>, /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - validity: Option<&'req str> + validity: Option<&'req str>, + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + is_publicly_leaked: Option, + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + is_multi_repo: Option } impl<'req> SecretScanningListAlertsForOrgParams<'req> { @@ -442,6 +502,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -458,6 +520,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -474,6 +538,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -490,6 +556,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -506,6 +574,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -522,6 +592,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -538,6 +610,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -554,6 +628,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: Some(before), after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -570,6 +646,8 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: Some(after), validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -586,6 +664,44 @@ impl<'req> SecretScanningListAlertsForOrgParams<'req> { before: self.before, after: self.after, validity: Some(validity), + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + pub fn is_publicly_leaked(self, is_publicly_leaked: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + page: self.page, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: Some(is_publicly_leaked), + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + pub fn is_multi_repo(self, is_multi_repo: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + page: self.page, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: Some(is_multi_repo), } } } @@ -621,7 +737,11 @@ pub struct SecretScanningListAlertsForRepoParams<'req> { /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty \"after\" query string. after: Option<&'req str>, /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - validity: Option<&'req str> + validity: Option<&'req str>, + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + is_publicly_leaked: Option, + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + is_multi_repo: Option } impl<'req> SecretScanningListAlertsForRepoParams<'req> { @@ -642,6 +762,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -658,6 +780,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -674,6 +798,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -690,6 +816,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -706,6 +834,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -722,6 +852,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -738,6 +870,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -754,6 +888,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: Some(before), after: self.after, validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -770,6 +906,8 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: Some(after), validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, } } @@ -786,6 +924,44 @@ impl<'req> SecretScanningListAlertsForRepoParams<'req> { before: self.before, after: self.after, validity: Some(validity), + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + pub fn is_publicly_leaked(self, is_publicly_leaked: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + page: self.page, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: Some(is_publicly_leaked), + is_multi_repo: self.is_multi_repo, + } + } + + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + pub fn is_multi_repo(self, is_multi_repo: bool) -> Self { + Self { + state: self.state, + secret_type: self.secret_type, + resolution: self.resolution, + sort: self.sort, + direction: self.direction, + page: self.page, + per_page: self.per_page, + before: self.before, + after: self.after, + validity: self.validity, + is_publicly_leaked: self.is_publicly_leaked, + is_multi_repo: Some(is_multi_repo), } } } diff --git a/src/endpoints/teams.rs b/src/endpoints/teams.rs index 2e84bbb..7795562 100644 --- a/src/endpoints/teams.rs +++ b/src/endpoints/teams.rs @@ -2186,7 +2186,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -2223,7 +2223,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsAddMemberLegacyError::Status404.into()), @@ -2238,7 +2238,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -2276,7 +2276,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsAddMemberLegacyError::Status404.into()), @@ -2397,7 +2397,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -2450,7 +2450,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -2532,7 +2532,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateProjectPermissionsInOrgError::Status403(github_response.to_json_async().await?).into()), @@ -2575,7 +2575,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateProjectPermissionsInOrgError::Status403(github_response.to_json()?).into()), @@ -2589,7 +2589,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. /// @@ -2617,7 +2617,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateProjectPermissionsLegacyError::Status403(github_response.to_json_async().await?).into()), @@ -2633,7 +2633,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. /// @@ -2662,7 +2662,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateProjectPermissionsLegacyError::Status403(github_response.to_json()?).into()), @@ -2708,7 +2708,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsAddOrUpdateRepoPermissionsInOrgError::Generic { code }.into()), @@ -2752,7 +2752,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsAddOrUpdateRepoPermissionsInOrgError::Generic { code }.into()), @@ -2765,7 +2765,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -2795,7 +2795,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateRepoPermissionsLegacyError::Status403(github_response.to_json_async().await?).into()), @@ -2810,7 +2810,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -2841,7 +2841,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsAddOrUpdateRepoPermissionsLegacyError::Status403(github_response.to_json()?).into()), @@ -2941,7 +2941,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -2983,7 +2983,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -3125,7 +3125,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -3171,7 +3171,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -3394,7 +3394,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -3439,7 +3439,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -3576,7 +3576,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Create a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -3621,7 +3621,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Create a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -3697,7 +3697,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionCommentInOrgError::Generic { code }.into()), @@ -3741,7 +3741,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionCommentInOrgError::Generic { code }.into()), @@ -3754,7 +3754,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -3784,7 +3784,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionCommentLegacyError::Generic { code }.into()), @@ -3797,7 +3797,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -3828,7 +3828,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionCommentLegacyError::Generic { code }.into()), @@ -3871,7 +3871,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionInOrgError::Generic { code }.into()), @@ -3915,7 +3915,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionInOrgError::Generic { code }.into()), @@ -3928,7 +3928,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -3958,7 +3958,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionLegacyError::Generic { code }.into()), @@ -3971,7 +3971,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -4002,7 +4002,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteDiscussionLegacyError::Generic { code }.into()), @@ -4045,7 +4045,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteInOrgError::Generic { code }.into()), @@ -4089,7 +4089,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsDeleteInOrgError::Generic { code }.into()), @@ -4102,7 +4102,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -4132,7 +4132,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsDeleteLegacyError::Status404(github_response.to_json_async().await?).into()), @@ -4147,7 +4147,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Delete a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -4178,7 +4178,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsDeleteLegacyError::Status404(github_response.to_json()?).into()), @@ -4365,7 +4365,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -4408,7 +4408,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -4539,7 +4539,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -4582,7 +4582,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -4626,7 +4626,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// [GitHub API docs for get_legacy](https://docs.github.com/rest/teams/teams#get-a-team-legacy) /// @@ -4666,7 +4666,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// [GitHub API docs for get_legacy](https://docs.github.com/rest/teams/teams#get-a-team-legacy) /// @@ -4706,7 +4706,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -4736,7 +4736,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsGetMemberLegacyError::Status404.into()), @@ -4749,7 +4749,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -4780,7 +4780,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsGetMemberLegacyError::Status404.into()), @@ -4893,7 +4893,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -4942,7 +4942,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -5172,7 +5172,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List child teams (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// [GitHub API docs for list_child_legacy](https://docs.github.com/rest/teams/teams#list-child-teams-legacy) /// @@ -5218,7 +5218,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List child teams (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// [GitHub API docs for list_child_legacy](https://docs.github.com/rest/teams/teams#list-child-teams-legacy) /// @@ -5362,7 +5362,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List discussion comments (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -5409,7 +5409,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List discussion comments (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -5554,7 +5554,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List discussions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -5601,7 +5601,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List discussions (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -5842,7 +5842,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team members (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -5888,7 +5888,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team members (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -6028,7 +6028,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -6073,7 +6073,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -6212,7 +6212,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team projects (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -6258,7 +6258,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team projects (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -6398,7 +6398,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team repositories (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// [GitHub API docs for list_repos_legacy](https://docs.github.com/rest/teams/teams#list-team-repositories-legacy) /// @@ -6442,7 +6442,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # List team repositories (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// [GitHub API docs for list_repos_legacy](https://docs.github.com/rest/teams/teams#list-team-repositories-legacy) /// @@ -6487,7 +6487,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -6522,7 +6522,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsRemoveMemberLegacyError::Status404.into()), @@ -6535,7 +6535,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// /// # Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -6571,7 +6571,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsRemoveMemberLegacyError::Status404.into()), @@ -6618,7 +6618,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsRemoveMembershipForUserInOrgError::Status403.into()), @@ -6666,7 +6666,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsRemoveMembershipForUserInOrgError::Status403.into()), @@ -6680,7 +6680,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -6713,7 +6713,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsRemoveMembershipForUserLegacyError::Status403.into()), @@ -6727,7 +6727,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -6761,7 +6761,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 403 => Err(TeamsRemoveMembershipForUserLegacyError::Status403.into()), @@ -6803,7 +6803,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveProjectInOrgError::Generic { code }.into()), @@ -6845,7 +6845,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveProjectInOrgError::Generic { code }.into()), @@ -6858,7 +6858,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -6886,7 +6886,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsRemoveProjectLegacyError::Status404(github_response.to_json_async().await?).into()), @@ -6901,7 +6901,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -6930,7 +6930,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(TeamsRemoveProjectLegacyError::Status404(github_response.to_json()?).into()), @@ -6973,7 +6973,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveRepoInOrgError::Generic { code }.into()), @@ -7015,7 +7015,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveRepoInOrgError::Generic { code }.into()), @@ -7028,7 +7028,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -7056,7 +7056,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveRepoLegacyError::Generic { code }.into()), @@ -7069,7 +7069,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -7098,7 +7098,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { code => Err(TeamsRemoveRepoLegacyError::Generic { code }.into()), @@ -7198,7 +7198,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -7241,7 +7241,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -7372,7 +7372,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -7415,7 +7415,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a discussion (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -7550,7 +7550,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// @@ -7598,7 +7598,7 @@ impl<'api, C: Client> Teams<'api, C> where AdapterError: From<::Err /// # Update a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// diff --git a/src/endpoints/users.rs b/src/endpoints/users.rs index 5dab2fc..c903462 100644 --- a/src/endpoints/users.rs +++ b/src/endpoints/users.rs @@ -521,6 +521,8 @@ pub enum UsersFollowError { Status403(BasicError), #[error("Requires authentication")] Status401(BasicError), + #[error("Validation failed, or the endpoint has been spammed.")] + Status422(ValidationError), #[error("Status code: {}", code)] Generic { code: u16 }, } @@ -532,6 +534,7 @@ impl From for AdapterError { UsersFollowError::Status404(_) => (String::from("Resource not found"), 404), UsersFollowError::Status403(_) => (String::from("Forbidden"), 403), UsersFollowError::Status401(_) => (String::from("Requires authentication"), 401), + UsersFollowError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422), UsersFollowError::Generic { code } => (String::from("Generic"), code) }; @@ -2273,7 +2276,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersBlockError::Status304.into()), @@ -2317,7 +2320,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersBlockError::Status304.into()), @@ -2360,7 +2363,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckBlockedError::Status404(github_response.to_json_async().await?).into()), @@ -2403,7 +2406,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckBlockedError::Status404(github_response.to_json()?).into()), @@ -2443,7 +2446,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckFollowingForUserError::Status404.into()), @@ -2481,7 +2484,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckFollowingForUserError::Status404.into()), @@ -2518,7 +2521,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckPersonIsFollowedByAuthenticatedError::Status404(github_response.to_json_async().await?).into()), @@ -2559,7 +2562,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersCheckPersonIsFollowedByAuthenticatedError::Status404(github_response.to_json()?).into()), @@ -2874,7 +2877,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeleteEmailForAuthenticatedUserError::Status304.into()), @@ -2918,7 +2921,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeleteEmailForAuthenticatedUserError::Status304.into()), @@ -2963,7 +2966,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersDeleteGpgKeyForAuthenticatedUserError::Status404(github_response.to_json_async().await?).into()), @@ -3009,7 +3012,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 404 => Err(UsersDeleteGpgKeyForAuthenticatedUserError::Status404(github_response.to_json()?).into()), @@ -3054,7 +3057,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeletePublicSshKeyForAuthenticatedUserError::Status304.into()), @@ -3099,7 +3102,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeletePublicSshKeyForAuthenticatedUserError::Status304.into()), @@ -3143,7 +3146,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 422 => Err(UsersDeleteSocialAccountForAuthenticatedUserError::Status422(github_response.to_json_async().await?).into()), @@ -3189,7 +3192,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 422 => Err(UsersDeleteSocialAccountForAuthenticatedUserError::Status422(github_response.to_json()?).into()), @@ -3234,7 +3237,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeleteSshSigningKeyForAuthenticatedUserError::Status304.into()), @@ -3279,7 +3282,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersDeleteSshSigningKeyForAuthenticatedUserError::Status304.into()), @@ -3323,13 +3326,14 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersFollowError::Status304.into()), 404 => Err(UsersFollowError::Status404(github_response.to_json_async().await?).into()), 403 => Err(UsersFollowError::Status403(github_response.to_json_async().await?).into()), 401 => Err(UsersFollowError::Status401(github_response.to_json_async().await?).into()), + 422 => Err(UsersFollowError::Status422(github_response.to_json_async().await?).into()), code => Err(UsersFollowError::Generic { code }.into()), } } @@ -3368,13 +3372,14 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersFollowError::Status304.into()), 404 => Err(UsersFollowError::Status404(github_response.to_json()?).into()), 403 => Err(UsersFollowError::Status403(github_response.to_json()?).into()), 401 => Err(UsersFollowError::Status401(github_response.to_json()?).into()), + 422 => Err(UsersFollowError::Status422(github_response.to_json()?).into()), code => Err(UsersFollowError::Generic { code }.into()), } } @@ -5695,7 +5700,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersUnblockError::Status304.into()), @@ -5738,7 +5743,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersUnblockError::Status304.into()), @@ -5780,7 +5785,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json_async().await?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersUnfollowError::Status304.into()), @@ -5823,7 +5828,7 @@ impl<'api, C: Client> Users<'api, C> where AdapterError: From<::Err // -- if github_response.is_success() { - Ok(github_response.to_json()?) + Ok(()) } else { match github_response.status_code() { 304 => Err(UsersUnfollowError::Status304.into()), diff --git a/src/models.rs b/src/models.rs index bedaacd..5c9c07d 100644 --- a/src/models.rs +++ b/src/models.rs @@ -513,6 +513,8 @@ pub struct AllOfrepositoryAdvisoryAuthor { pub site_admin: Option, #[serde(skip_serializing_if="Option::is_none")] pub starred_at: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// A temporary private fork of the advisory's repository for collaborating on a fix. @@ -703,6 +705,8 @@ pub struct AllOfrepositoryAdvisoryPublisher { pub site_admin: Option, #[serde(skip_serializing_if="Option::is_none")] pub starred_at: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// The created [`repository`](https://docs.github.com/rest/repos/repos#get-a-repository) resource. @@ -1423,6 +1427,29 @@ impl From for AnyOfrepositoryRulesetConditions { } } +/// API Insights usage route stats for an actor +pub type ApiInsightsRouteStats = Vec; + +/// API Insights usage subject stats for an organization +pub type ApiInsightsSubjectStats = Vec; + +/// API Insights usage summary stats for an organization +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiInsightsSummaryStats { + /// The total number of requests within the queried time period + #[serde(skip_serializing_if="Option::is_none")] + pub total_request_count: Option, + /// The total number of requests that were rate limited within the queried time period + #[serde(skip_serializing_if="Option::is_none")] + pub rate_limited_request_count: Option, +} + +/// API Insights usage time stats for an organization +pub type ApiInsightsTimeStats = Vec; + +/// API Insights usage stats for a user +pub type ApiInsightsUserStats = Vec; + /// Api Overview #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct ApiOverview { @@ -1462,6 +1489,76 @@ pub struct ApiOverview { pub domains: Option, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiinsightsroutestatsInner { + /// The HTTP method + #[serde(skip_serializing_if="Option::is_none")] + pub http_method: Option, + /// The API path's route template + #[serde(skip_serializing_if="Option::is_none")] + pub api_route: Option, + /// The total number of requests within the queried time period + #[serde(skip_serializing_if="Option::is_none")] + pub total_request_count: Option, + /// The total number of requests that were rate limited within the queried time period + #[serde(skip_serializing_if="Option::is_none")] + pub rate_limited_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_rate_limited_timestamp: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_request_timestamp: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiinsightssubjectstatsInner { + #[serde(skip_serializing_if="Option::is_none")] + pub subject_type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subject_name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subject_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub total_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub rate_limited_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_rate_limited_timestamp: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_request_timestamp: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiinsightstimestatsInner { + #[serde(skip_serializing_if="Option::is_none")] + pub timestamp: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub total_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub rate_limited_request_count: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiinsightsuserstatsInner { + #[serde(skip_serializing_if="Option::is_none")] + pub actor_type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub actor_name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub actor_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub integration_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub oauth_application_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub total_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub rate_limited_request_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_rate_limited_timestamp: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub last_request_timestamp: Option, +} + #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct ApioverviewDomains { #[serde(skip_serializing_if="Option::is_none")] @@ -2517,6 +2614,9 @@ pub struct BasegistFiles { pub raw_url: Option, #[serde(skip_serializing_if="Option::is_none")] pub size: Option, + /// The encoding used for `content`. Currently, `\"utf-8\"` and `\"base64\"` are supported. + #[serde(skip_serializing_if="Option::is_none")] + pub encoding: Option, } /// Basic Error @@ -2607,7 +2707,7 @@ pub struct PatchReposUpdateStatusCheckProtection { /// Require branches to be up to date before merging. #[serde(skip_serializing_if="Option::is_none")] pub strict: Option, - /// **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + /// **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. #[serde(skip_serializing_if="Option::is_none")] pub contexts: Option>, /// The list of status checks to require in order to merge into this branch. @@ -2901,7 +3001,7 @@ pub struct PostCodespacesCreateWithRepoForAuthenticatedUser { /// The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. #[serde(skip_serializing_if="Option::is_none")] pub location: Option, - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. #[serde(skip_serializing_if="Option::is_none")] pub geo: Option, /// IP for location auto-detection when proxying a request @@ -2972,7 +3072,7 @@ pub struct PostReposCreateCommitComment { /// Line index in the diff to comment on. #[serde(skip_serializing_if="Option::is_none")] pub position: Option, - /// **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. + /// **Closing down notice**. Use **position** parameter instead. Line number in the file to comment on. #[serde(skip_serializing_if="Option::is_none")] pub line: Option, } @@ -3105,7 +3205,7 @@ pub struct PostReposCreateDispatchEvent { /// A custom webhook event name. Must be 100 characters or fewer. #[serde(skip_serializing_if="Option::is_none")] pub event_type: Option, - /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB. #[serde(skip_serializing_if="Option::is_none")] pub client_payload: Option>>, } @@ -3204,7 +3304,7 @@ pub struct PatchOrgsUpdate { /// Whether organization members can create public repositories, which are visible to anyone. For more information, see \"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\" in the GitHub Help documentation. #[serde(skip_serializing_if="Option::is_none")] pub members_can_create_public_repositories: Option, - /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. #[serde(skip_serializing_if="Option::is_none")] pub members_allowed_repository_creation_type: Option, /// Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. @@ -3224,22 +3324,22 @@ pub struct PatchOrgsUpdate { pub web_commit_signoff_required: Option, #[serde(skip_serializing_if="Option::is_none")] pub blog: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub advanced_security_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub dependabot_alerts_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub dependabot_security_updates_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub dependency_graph_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see \"[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).\" You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection_enabled_for_new_repositories: Option, /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. @@ -3248,6 +3348,9 @@ pub struct PatchOrgsUpdate { /// If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection_custom_link: Option, + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + #[serde(skip_serializing_if="Option::is_none")] + pub deploy_keys_enabled_for_repositories: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -3463,7 +3566,7 @@ pub struct PostIssuesCreate { /// The contents of the issue. #[serde(skip_serializing_if="Option::is_none")] pub body: Option, - /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ + /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -3498,7 +3601,7 @@ pub struct PatchIssuesUpdate { /// The contents of the issue. #[serde(skip_serializing_if="Option::is_none")] pub body: Option, - /// Username to assign to this issue. **This field is deprecated.** + /// Username to assign to this issue. **This field is closing down.** #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, /// The open or closed state of the issue. @@ -3911,7 +4014,7 @@ pub struct PostCodespacesCreateWithPrForAuthenticatedUser { /// The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. #[serde(skip_serializing_if="Option::is_none")] pub location: Option, - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. #[serde(skip_serializing_if="Option::is_none")] pub geo: Option, /// IP for location auto-detection when proxying a request @@ -3951,7 +4054,7 @@ pub struct PostPullsCreateReviewComment { /// The relative path to the file that necessitates a comment. #[serde(skip_serializing_if="Option::is_none")] pub path: Option, - /// **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + /// **This parameter is closing down. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. #[serde(skip_serializing_if="Option::is_none")] pub position: Option, /// In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see \"[Diff view options](https://docs.github.com/articles/about-comparing-branches-in-pull-requests#diff-view-options)\" in the GitHub Help documentation. @@ -4335,7 +4438,7 @@ pub struct PatchTeamsUpdateLegacy { /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. #[serde(skip_serializing_if="Option::is_none")] pub notification_setting: Option, - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. #[serde(skip_serializing_if="Option::is_none")] pub permission: Option, /// The ID of a team to set as the parent team. @@ -4847,6 +4950,11 @@ pub struct PostCodeSecurityCreateConfiguration { /// The enablement status of secret scanning push protection #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection: Option, + /// The enablement status of secret scanning delegated bypass + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass_options: Option, /// The enablement status of secret scanning validity checks #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_validity_checks: Option, @@ -4909,6 +5017,11 @@ pub struct PatchCodeSecurityUpdateConfiguration { /// The enablement status of secret scanning push protection #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection: Option, + /// The enablement status of secret scanning delegated bypass + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass_options: Option, /// The enablement status of secret scanning validity checks #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_validity_checks: Option, @@ -5321,7 +5434,7 @@ pub struct PostReposCreateInOrg { /// Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** #[serde(skip_serializing_if="Option::is_none")] pub delete_branch_on_merge: Option, - /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, /// Required when using `squash_merge_commit_message`. The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). @@ -5401,7 +5514,7 @@ pub struct PostTeamsCreate { /// The notification setting the team has chosen. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. Default: `notifications_enabled` #[serde(skip_serializing_if="Option::is_none")] pub notification_setting: Option, - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. #[serde(skip_serializing_if="Option::is_none")] pub permission: Option, /// The ID of a team to set as the parent team. @@ -5423,7 +5536,7 @@ pub struct PatchTeamsUpdateInOrg { /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. #[serde(skip_serializing_if="Option::is_none")] pub notification_setting: Option, - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. #[serde(skip_serializing_if="Option::is_none")] pub permission: Option, /// The ID of a team to set as the parent team. @@ -5663,7 +5776,7 @@ pub struct PatchReposUpdate { /// Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. #[serde(skip_serializing_if="Option::is_none")] pub allow_update_branch: Option, - /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, /// Required when using `squash_merge_commit_message`. The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). @@ -6076,6 +6189,8 @@ pub struct BranchrestrictionpolicyOwner { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -6159,6 +6274,8 @@ pub struct BranchrestrictionpolicyUsers { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -7567,6 +7684,11 @@ pub struct CodeSecurityConfiguration { /// The enablement status of secret scanning push protection #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection: Option, + /// The enablement status of secret scanning delegated bypass + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub secret_scanning_delegated_bypass_options: Option, /// The enablement status of secret scanning validity checks #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_validity_checks: Option, @@ -8086,6 +8208,8 @@ pub struct Collaborator { pub permissions: Option, #[serde(skip_serializing_if="Option::is_none")] pub role_name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -8692,6 +8816,8 @@ pub struct Contributor { pub email: Option, #[serde(skip_serializing_if="Option::is_none")] pub name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// Contributor Activity @@ -8742,6 +8868,60 @@ pub struct ConvertedNoteToIssueIssueEvent { pub project_card: Option, } +/// Usage metrics for Copilot Chat in github.com +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotDotcomChat { + /// Total number of users who prompted Copilot Chat on github.com at least once. + #[serde(rename = "total_engaged_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// List of model metrics for a custom models and the default model. + #[serde(rename = "models")] + #[serde(skip_serializing_if="Option::is_none")] + pub models: Option>, +} + +/// Usage metrics for Copilot for pull requests. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotDotcomPullRequests { + /// The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + #[serde(rename = "total_engaged_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries + #[serde(rename = "repositories")] + #[serde(skip_serializing_if="Option::is_none")] + pub repositories: Option>, +} + +/// Usage metrics for Copilot Chat in the IDE. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotIdeChat { + /// Total number of users who prompted Copilot Chat in the IDE. + #[serde(rename = "total_engaged_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + #[serde(rename = "editors")] + #[serde(skip_serializing_if="Option::is_none")] + pub editors: Option>, +} + +/// Usage metrics for Copilot editor code completions in the IDE. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotIdeCodeCompletions { + /// Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. + #[serde(rename = "total_engaged_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// Code completion metrics for active languages. + #[serde(rename = "languages")] + #[serde(skip_serializing_if="Option::is_none")] + pub languages: Option>, + #[serde(rename = "editors")] + #[serde(skip_serializing_if="Option::is_none")] + pub editors: Option>, +} + /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct CopilotOrganizationDetails { @@ -8862,6 +9042,192 @@ pub struct CopilotUsageMetrics { pub breakdown: Option>, } +/// Copilot usage metrics for a given day. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotUsageMetricsDay { + /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. + #[serde(rename = "date")] + #[serde(skip_serializing_if="Option::is_none")] + pub date: Option>, + /// The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + #[serde(rename = "total_active_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_active_users: Option, + /// The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + #[serde(rename = "total_engaged_users")] + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + #[serde(rename = "copilot_ide_code_completions")] + #[serde(skip_serializing_if="Option::is_none")] + pub copilot_ide_code_completions: Option, + #[serde(rename = "copilot_ide_chat")] + #[serde(skip_serializing_if="Option::is_none")] + pub copilot_ide_chat: Option, + #[serde(rename = "copilot_dotcom_chat")] + #[serde(skip_serializing_if="Option::is_none")] + pub copilot_dotcom_chat: Option, + #[serde(rename = "copilot_dotcom_pull_requests")] + #[serde(skip_serializing_if="Option::is_none")] + pub copilot_dotcom_pull_requests: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotdotcomchatModels { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Indicates whether a model is custom or default. + #[serde(skip_serializing_if="Option::is_none")] + pub is_custom_model: Option, + /// The training date for the custom model (if applicable). + #[serde(skip_serializing_if="Option::is_none")] + pub custom_model_training_date: Option, + /// Total number of users who prompted Copilot Chat on github.com at least once for each model. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// Total number of chats initiated by users on github.com. + #[serde(skip_serializing_if="Option::is_none")] + pub total_chats: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotdotcompullrequestsModels { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Indicates whether a model is custom or default. + #[serde(skip_serializing_if="Option::is_none")] + pub is_custom_model: Option, + /// The training date for the custom model. + #[serde(skip_serializing_if="Option::is_none")] + pub custom_model_training_date: Option, + /// The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + #[serde(skip_serializing_if="Option::is_none")] + pub total_pr_summaries_created: Option, + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotdotcompullrequestsRepositories { + /// Repository name + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// List of model metrics for custom models and the default model. + #[serde(skip_serializing_if="Option::is_none")] + pub models: Option>, +} + +/// Copilot Chat metrics, for active editors. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidechatEditors { + /// Name of the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// The number of users who prompted Copilot Chat in the specified editor. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// List of model metrics for custom models and the default model. + #[serde(skip_serializing_if="Option::is_none")] + pub models: Option>, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidechatModels { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Indicates whether a model is custom or default. + #[serde(skip_serializing_if="Option::is_none")] + pub is_custom_model: Option, + /// The training date for the custom model. + #[serde(skip_serializing_if="Option::is_none")] + pub custom_model_training_date: Option, + /// The number of users who prompted Copilot Chat in the given editor and model. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// The total number of chats initiated by users in the given editor and model. + #[serde(skip_serializing_if="Option::is_none")] + pub total_chats: Option, + /// The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub total_chat_insertion_events: Option, + /// The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub total_chat_copy_events: Option, +} + +/// Copilot code completion metrics for active editors. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidecodecompletionsEditors { + /// Name of the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// List of model metrics for custom models and the default model. + #[serde(skip_serializing_if="Option::is_none")] + pub models: Option>, +} + +/// Usage metrics for a given language for the given editor for Copilot code completions. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidecodecompletionsLanguages { + /// Name of the language used for Copilot code completion suggestions. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, +} + +/// Usage metrics for a given language for the given editor for Copilot code completions. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidecodecompletionsLanguages1 { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// The number of Copilot code suggestions generated for the given editor, for the given language. + #[serde(skip_serializing_if="Option::is_none")] + pub total_code_suggestions: Option, + /// The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + #[serde(skip_serializing_if="Option::is_none")] + pub total_code_acceptances: Option, + /// The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + #[serde(skip_serializing_if="Option::is_none")] + pub total_code_lines_suggested: Option, + /// The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. + #[serde(skip_serializing_if="Option::is_none")] + pub total_code_lines_accepted: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct CopilotidecodecompletionsModels { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + /// Indicates whether a model is custom or default. + #[serde(skip_serializing_if="Option::is_none")] + pub is_custom_model: Option, + /// The training date for the custom model. + #[serde(skip_serializing_if="Option::is_none")] + pub custom_model_training_date: Option, + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. + #[serde(skip_serializing_if="Option::is_none")] + pub total_engaged_users: Option, + /// Code completion metrics for active languages, for the given editor. + #[serde(skip_serializing_if="Option::is_none")] + pub languages: Option>, +} + /// Breakdown of Copilot usage by editor for this language #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct CopilotusagemetricsBreakdown { @@ -9315,6 +9681,9 @@ pub struct DependencygraphspdxsbomSbom { #[serde(rename = "spdxVersion")] #[serde(skip_serializing_if="Option::is_none")] pub spdx_version: Option, + /// An optional comment about the SPDX document. + #[serde(skip_serializing_if="Option::is_none")] + pub comment: Option, #[serde(rename = "creationInfo")] #[serde(skip_serializing_if="Option::is_none")] pub creation_info: Option, @@ -9325,16 +9694,14 @@ pub struct DependencygraphspdxsbomSbom { #[serde(rename = "dataLicense")] #[serde(skip_serializing_if="Option::is_none")] pub data_license: Option, - /// The name of the repository that the SPDX document describes. - #[serde(rename = "documentDescribes")] - #[serde(skip_serializing_if="Option::is_none")] - pub document_describes: Option>, /// The namespace for the SPDX document. #[serde(rename = "documentNamespace")] #[serde(skip_serializing_if="Option::is_none")] pub document_namespace: Option, #[serde(skip_serializing_if="Option::is_none")] pub packages: Option>, + #[serde(skip_serializing_if="Option::is_none")] + pub relationships: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -9404,6 +9771,22 @@ pub struct DependencygraphspdxsbomSbomPackages { pub external_refs: Option>, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct DependencygraphspdxsbomSbomRelationships { + /// The type of relationship between the two SPDX elements. + #[serde(rename = "relationshipType")] + #[serde(skip_serializing_if="Option::is_none")] + pub relationship_type: Option, + /// The SPDX identifier of the package that is the source of the relationship. + #[serde(rename = "spdxElementId")] + #[serde(skip_serializing_if="Option::is_none")] + pub spdx_element_id: Option, + /// The SPDX identifier of the package that is the target of the relationship. + #[serde(rename = "relatedSpdxElement")] + #[serde(skip_serializing_if="Option::is_none")] + pub related_spdx_element: Option, +} + /// An SSH key granting access to a single repository. #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct DeployKey { @@ -9425,6 +9808,8 @@ pub struct DeployKey { pub added_by: Option, #[serde(skip_serializing_if="Option::is_none")] pub last_used: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub enabled: Option, } /// The [deployment](https://docs.github.com/rest/deployments/deployments#list-deployments). @@ -9665,7 +10050,7 @@ pub struct DeploymentStatus { /// The environment of the deployment that the status is for. #[serde(skip_serializing_if="Option::is_none")] pub environment: Option, - /// Deprecated: the URL to associate with this status. + /// Closing down notice: the URL to associate with this status. #[serde(skip_serializing_if="Option::is_none")] pub target_url: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -10223,7 +10608,7 @@ pub struct DeploymentWorkflowRunHeadRepository { #[serde(skip_serializing_if="Option::is_none")] pub notifications_url: Option, #[serde(skip_serializing_if="Option::is_none")] - pub owner: Option, + pub owner: Option, #[serde(skip_serializing_if="Option::is_none")] pub private: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -10248,6 +10633,47 @@ pub struct DeploymentWorkflowRunHeadRepository { pub url: Option, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct DeploymentWorkflowRunHeadRepositoryOwner { + #[serde(skip_serializing_if="Option::is_none")] + pub avatar_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub followers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub following_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gists_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gravatar_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub html_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub login: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub node_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub organizations_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub received_events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repos_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub starred_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscriptions_url: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub url: Option, +} + #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct DeploymentWorkflowRunReferencedWorkflows { #[serde(skip_serializing_if="Option::is_none")] @@ -10470,7 +10896,7 @@ pub struct EnterpriseTeam { #[serde(skip_serializing_if="Option::is_none")] pub sync_to_organizations: Option, #[serde(skip_serializing_if="Option::is_none")] - pub group_id: Option, + pub group_id: Option, #[serde(skip_serializing_if="Option::is_none")] pub html_url: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -11053,7 +11479,7 @@ pub struct Gist { #[serde(skip_serializing_if="Option::is_none")] pub html_url: Option, #[serde(skip_serializing_if="Option::is_none")] - pub files: Option>, + pub files: Option>, #[serde(skip_serializing_if="Option::is_none")] pub public: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -11115,6 +11541,21 @@ pub struct GistCommit { pub committed_at: Option>, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct GistFiles { + #[serde(skip_serializing_if="Option::is_none")] + pub filename: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub language: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub raw_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub size: Option, +} + /// Gist History #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct GistHistory { @@ -11221,6 +11662,9 @@ pub struct GistsimpleFiles { pub truncated: Option, #[serde(skip_serializing_if="Option::is_none")] pub content: Option, + /// The encoding used for `content`. Currently, `\"utf-8\"` and `\"base64\"` are supported. + #[serde(skip_serializing_if="Option::is_none")] + pub encoding: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -11928,7 +12372,14 @@ pub struct GetCopilotListCopilotSeatsResponse200 { pub seats: Option>, } -/// The total number of seat assignments cancelled. +/// The total number of seats set to \"pending cancellation\" for members of the specified team(s). +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct DeleteCopilotCancelCopilotSeatAssignmentForTeamsResponse200 { + #[serde(skip_serializing_if="Option::is_none")] + pub seats_cancelled: Option, +} + +/// The total number of seats set to \"pending cancellation\" for the specified users. #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct DeleteCopilotCancelCopilotSeatAssignmentForUsersResponse200 { #[serde(skip_serializing_if="Option::is_none")] @@ -11944,19 +12395,19 @@ pub struct GetDependabotListOrgSecretsResponse200 { } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetAppsListInstallationsForAuthenticatedUserResponse200 { +pub struct GetActionsGetActionsCacheUsageByRepoForOrgResponse200 { #[serde(skip_serializing_if="Option::is_none")] pub total_count: Option, #[serde(skip_serializing_if="Option::is_none")] - pub installations: Option>, + pub repository_cache_usages: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetActionsGetActionsCacheUsageByRepoForOrgResponse200 { +pub struct GetAppsListInstallationsForAuthenticatedUserResponse200 { #[serde(skip_serializing_if="Option::is_none")] pub total_count: Option, #[serde(skip_serializing_if="Option::is_none")] - pub repository_cache_usages: Option>, + pub installations: Option>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -12044,16 +12495,24 @@ pub struct GetChecksListForRefResponse200 { pub check_runs: Option>, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct GetActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse200 { + #[serde(skip_serializing_if="Option::is_none")] + pub total_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repositories: Option>, +} + #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct GetCodespacesListDevcontainersInRepositoryForAuthenticatedUserResponse200 { #[serde(skip_serializing_if="Option::is_none")] pub total_count: Option, #[serde(skip_serializing_if="Option::is_none")] - pub devcontainers: Option>, + pub devcontainers: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct InlineResponse20029Devcontainers { +pub struct InlineResponse20030Devcontainers { #[serde(skip_serializing_if="Option::is_none")] pub path: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -12062,14 +12521,6 @@ pub struct InlineResponse20029Devcontainers { pub display_name: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse200 { - #[serde(skip_serializing_if="Option::is_none")] - pub total_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub repositories: Option>, -} - #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct GetCodespacesCodespaceMachinesForAuthenticatedUserResponse200 { #[serde(skip_serializing_if="Option::is_none")] @@ -12083,11 +12534,11 @@ pub struct GetCodespacesPreFlightWithRepoForAuthenticatedUserResponse200 { #[serde(skip_serializing_if="Option::is_none")] pub billable_owner: Option, #[serde(skip_serializing_if="Option::is_none")] - pub defaults: Option, + pub defaults: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct InlineResponse20031Defaults { +pub struct InlineResponse20032Defaults { #[serde(skip_serializing_if="Option::is_none")] pub location: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -12112,34 +12563,34 @@ pub struct GetChecksListSuitesForRefResponse200 { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(untagged)] -pub enum InlineResponse20034 { - InlineResponse20034Variant0(ContentDirectory), - InlineResponse20034Variant1(ContentFile), - InlineResponse20034Variant2(ContentSymlink), - InlineResponse20034Variant3(ContentSubmodule), +pub enum InlineResponse20035 { + InlineResponse20035Variant0(ContentDirectory), + InlineResponse20035Variant1(ContentFile), + InlineResponse20035Variant2(ContentSymlink), + InlineResponse20035Variant3(ContentSubmodule), } -impl From for InlineResponse20034 { +impl From for InlineResponse20035 { fn from(value: ContentDirectory) -> Self { - InlineResponse20034::InlineResponse20034Variant0(value) + InlineResponse20035::InlineResponse20035Variant0(value) } } -impl From for InlineResponse20034 { +impl From for InlineResponse20035 { fn from(value: ContentFile) -> Self { - InlineResponse20034::InlineResponse20034Variant1(value) + InlineResponse20035::InlineResponse20035Variant1(value) } } -impl From for InlineResponse20034 { +impl From for InlineResponse20035 { fn from(value: ContentSymlink) -> Self { - InlineResponse20034::InlineResponse20034Variant2(value) + InlineResponse20035::InlineResponse20035Variant2(value) } } -impl From for InlineResponse20034 { +impl From for InlineResponse20035 { fn from(value: ContentSubmodule) -> Self { - InlineResponse20034::InlineResponse20034Variant3(value) + InlineResponse20035::InlineResponse20035Variant3(value) } } @@ -12179,20 +12630,20 @@ pub struct GetReposGetAllDeploymentProtectionRulesResponse200 { } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetReposListCustomDeploymentRuleIntegrationsResponse200 { - /// The total number of custom deployment protection rule integrations available for this environment. +pub struct GetActionsListSelfHostedRunnerGroupsForOrgResponse200 { #[serde(skip_serializing_if="Option::is_none")] - pub total_count: Option, + pub total_count: Option, #[serde(skip_serializing_if="Option::is_none")] - pub available_custom_deployment_protection_rule_integrations: Option>, + pub runner_groups: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetActionsListSelfHostedRunnerGroupsForOrgResponse200 { +pub struct GetReposListCustomDeploymentRuleIntegrationsResponse200 { + /// The total number of custom deployment protection rule integrations available for this environment. #[serde(skip_serializing_if="Option::is_none")] - pub total_count: Option, + pub total_count: Option, #[serde(skip_serializing_if="Option::is_none")] - pub runner_groups: Option>, + pub available_custom_deployment_protection_rule_integrations: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -12291,6 +12742,14 @@ pub struct GetSearchUsersResponse200 { pub items: Option>, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct GetActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse200 { + #[serde(skip_serializing_if="Option::is_none")] + pub total_count: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repositories: Option>, +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum GetUsersGetByUsernameResponse200 { @@ -12310,14 +12769,6 @@ impl From for GetUsersGetByUsernameResponse200 { } } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct GetActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse200 { - #[serde(skip_serializing_if="Option::is_none")] - pub total_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub repositories: Option>, -} - #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct GetCodespacesListSecretsForAuthenticatedUserResponse200 { #[serde(skip_serializing_if="Option::is_none")] @@ -12339,11 +12790,11 @@ pub struct GetAppsListInstallationReposForAuthenticatedUserResponse200 { #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct GetUsersListAttestationsResponse200 { #[serde(skip_serializing_if="Option::is_none")] - pub attestations: Option>, + pub attestations: Option>, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct InlineResponse20052Attestations { +pub struct InlineResponse20053Attestations { #[serde(skip_serializing_if="Option::is_none")] pub bundle: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -12453,7 +12904,14 @@ pub struct PostActionsGenerateRunnerJitconfigForRepoResponse201 { pub encoded_jit_config: Option, } -/// The total number of seat assignments created. +/// The total number of seats created for members of the specified team(s). +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct PostCopilotAddCopilotSeatsForTeamsResponse201 { + #[serde(skip_serializing_if="Option::is_none")] + pub seats_created: Option, +} + +/// The total number of seats created for the specified user(s). #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct PostCopilotAddCopilotSeatsForUsersResponse201 { #[serde(skip_serializing_if="Option::is_none")] @@ -12900,7 +13358,7 @@ pub struct Issue { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -12968,9 +13426,9 @@ pub struct Issue1 { #[serde(skip_serializing_if="Option::is_none")] pub active_lock_reason: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignee: Option, + pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -13040,7 +13498,7 @@ pub struct Issue2 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -13110,7 +13568,7 @@ pub struct Issue3 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -13248,9 +13706,9 @@ pub struct Issue5 { #[serde(skip_serializing_if="Option::is_none")] pub active_lock_reason: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignee: Option, + pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -13458,9 +13916,9 @@ pub struct Issue8 { #[serde(skip_serializing_if="Option::is_none")] pub active_lock_reason: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignee: Option, + pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -14921,6 +15379,8 @@ pub struct NullableCollaborator { pub permissions: Option, #[serde(skip_serializing_if="Option::is_none")] pub role_name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -15518,7 +15978,7 @@ pub struct NullableRepository { /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. #[serde(skip_serializing_if="Option::is_none")] pub allow_update_branch: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, /// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). @@ -15748,7 +16208,7 @@ pub struct NullableRepositoryWebhooks { /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. #[serde(skip_serializing_if="Option::is_none")] pub allow_update_branch: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, /// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). @@ -15875,6 +16335,8 @@ pub struct NullableSimpleUser { pub site_admin: Option, #[serde(skip_serializing_if="Option::is_none")] pub starred_at: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// Groups of organization members that gives permissions on specified repositories. @@ -17607,6 +18069,9 @@ pub struct OrganizationFull { pub private_gists: Option, #[serde(skip_serializing_if="Option::is_none")] pub disk_usage: Option, + /// The number of collaborators on private repositories. This field may be null if the number of private repositories is over 50,000. + #[serde(skip_serializing_if="Option::is_none")] + pub collaborators: Option, #[serde(skip_serializing_if="Option::is_none")] pub billing_email: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -17635,22 +18100,22 @@ pub struct OrganizationFull { pub members_can_fork_private_repositories: Option, #[serde(skip_serializing_if="Option::is_none")] pub web_commit_signoff_required: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub advanced_security_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub dependabot_alerts_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub dependabot_security_updates_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub dependency_graph_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_enabled_for_new_repositories: Option, - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role. #[serde(skip_serializing_if="Option::is_none")] pub secret_scanning_push_protection_enabled_for_new_repositories: Option, /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. @@ -17665,6 +18130,9 @@ pub struct OrganizationFull { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub archived_at: Option>, + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + #[serde(skip_serializing_if="Option::is_none")] + pub deploy_keys_enabled_for_repositories: Option, } /// Organization Invitation @@ -17699,7 +18167,7 @@ pub struct OrganizationInvitation { /// Minimal representation of an organization programmatic access grant for enumerations #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct OrganizationProgrammaticAccessGrant { - /// Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + /// Unique identifier of the fine-grained personal access token grant. The `pat_id` used to get details about an approved fine-grained personal access token. #[serde(skip_serializing_if="Option::is_none")] pub id: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -17715,6 +18183,12 @@ pub struct OrganizationProgrammaticAccessGrant { /// Date and time when the fine-grained personal access token was approved to access the organization. #[serde(skip_serializing_if="Option::is_none")] pub access_granted_at: Option, + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + #[serde(skip_serializing_if="Option::is_none")] + pub token_id: Option, + /// The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. + #[serde(skip_serializing_if="Option::is_none")] + pub token_name: Option, /// Whether the associated fine-grained personal access token has expired. #[serde(skip_serializing_if="Option::is_none")] pub token_expired: Option, @@ -17748,6 +18222,12 @@ pub struct OrganizationProgrammaticAccessGrantRequest { /// Date and time when the request for access was created. #[serde(skip_serializing_if="Option::is_none")] pub created_at: Option, + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + #[serde(skip_serializing_if="Option::is_none")] + pub token_id: Option, + /// The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. + #[serde(skip_serializing_if="Option::is_none")] + pub token_name: Option, /// Whether the associated fine-grained personal access token has expired. #[serde(skip_serializing_if="Option::is_none")] pub token_expired: Option, @@ -17833,6 +18313,12 @@ pub struct OrganizationSecretScanningAlert { /// The token status as of the latest validity check. #[serde(skip_serializing_if="Option::is_none")] pub validity: Option, + /// Whether the secret was publicly leaked. + #[serde(skip_serializing_if="Option::is_none")] + pub publicly_leaked: Option, + /// Whether the detected secret was found in multiple repositories in the same organization or enterprise. + #[serde(skip_serializing_if="Option::is_none")] + pub multi_repo: Option, } /// A GitHub organization. @@ -17944,6 +18430,24 @@ pub struct OrgsorgcodesecurityconfigurationsDependencyGraphAutosubmitActionOptio pub labeled_runners: Option, } +/// Feature options for secret scanning delegated bypass +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct OrgsorgcodesecurityconfigurationsSecretScanningDelegatedBypassOptions { + /// The bypass reviewers for secret scanning delegated bypass + #[serde(skip_serializing_if="Option::is_none")] + pub reviewers: Option>, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct OrgsorgcodesecurityconfigurationsSecretScanningDelegatedBypassOptionsReviewers { + /// The ID of the team or role selected as a bypass reviewer + #[serde(skip_serializing_if="Option::is_none")] + pub reviewer_id: Option, + /// The type of the bypass reviewer + #[serde(skip_serializing_if="Option::is_none")] + pub reviewer_type: Option, +} + /// Feature options for Automatic dependency submission #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct OrgsorgcodesecurityconfigurationsconfigurationIdDependencyGraphAutosubmitActionOptions { @@ -18359,6 +18863,12 @@ pub struct PersonalAccessTokenRequest { /// Date and time when the request for access was created. #[serde(skip_serializing_if="Option::is_none")] pub created_at: Option, + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + #[serde(skip_serializing_if="Option::is_none")] + pub token_id: Option, + /// The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. + #[serde(skip_serializing_if="Option::is_none")] + pub token_name: Option, /// Whether the associated fine-grained personal access token has expired. #[serde(skip_serializing_if="Option::is_none")] pub token_expired: Option, @@ -18446,6 +18956,8 @@ pub struct PrivateUser { #[serde(skip_serializing_if="Option::is_none")] pub id: Option, #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, + #[serde(skip_serializing_if="Option::is_none")] pub node_id: Option, #[serde(skip_serializing_if="Option::is_none")] pub avatar_url: Option, @@ -18523,8 +19035,6 @@ pub struct PrivateUser { #[serde(skip_serializing_if="Option::is_none")] pub plan: Option, #[serde(skip_serializing_if="Option::is_none")] - pub suspended_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] pub business_plus: Option, #[serde(skip_serializing_if="Option::is_none")] pub ldap_dn: Option, @@ -18990,6 +19500,8 @@ pub struct PublicUser { #[serde(skip_serializing_if="Option::is_none")] pub id: Option, #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, + #[serde(skip_serializing_if="Option::is_none")] pub node_id: Option, #[serde(skip_serializing_if="Option::is_none")] pub avatar_url: Option, @@ -19055,8 +19567,6 @@ pub struct PublicUser { #[serde(skip_serializing_if="Option::is_none")] pub plan: Option, #[serde(skip_serializing_if="Option::is_none")] - pub suspended_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] pub private_gists: Option, #[serde(skip_serializing_if="Option::is_none")] pub total_private_repos: Option, @@ -19197,7 +19707,7 @@ pub struct PullRequest1 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19303,7 +19813,7 @@ pub struct PullRequest10 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19424,7 +19934,7 @@ pub struct PullRequest11 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19530,7 +20040,7 @@ pub struct PullRequest12 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19651,7 +20161,7 @@ pub struct PullRequest13 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19772,7 +20282,7 @@ pub struct PullRequest2 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19893,7 +20403,7 @@ pub struct PullRequest3 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -19999,7 +20509,7 @@ pub struct PullRequest4 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -20105,7 +20615,7 @@ pub struct PullRequest5 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -21158,7 +21668,7 @@ pub struct PullRequestWebhook { #[serde(skip_serializing_if="Option::is_none")] pub head: Option, #[serde(skip_serializing_if="Option::is_none")] - pub base: Option, + pub base: Option, #[serde(skip_serializing_if="Option::is_none")] pub _links: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -21214,201 +21724,11 @@ pub struct PullRequestWebhook { /// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). #[serde(skip_serializing_if="Option::is_none")] pub squash_merge_commit_title: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead.** #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestBase { - #[serde(skip_serializing_if="Option::is_none")] - pub label: Option, - #[serde(rename = "ref")] - #[serde(skip_serializing_if="Option::is_none")] - pub git_ref: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub repo: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub sha: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub user: Option, -} - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestBaseRepo { - #[serde(skip_serializing_if="Option::is_none")] - pub archive_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub assignees_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub blobs_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub branches_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub collaborators_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub comments_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub commits_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub compare_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub contents_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub contributors_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub deployments_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub downloads_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub fork: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub full_name: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_commits_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_refs_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_tags_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub hooks_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub html_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub is_template: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub node_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issue_comment_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issue_events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issues_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub keys_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub labels_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub languages_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub merges_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub milestones_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub notifications_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub owner: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub private: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub pulls_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub releases_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub stargazers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub statuses_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscribers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscription_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub tags_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub teams_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub trees_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub clone_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub default_branch: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_downloads: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_issues: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_projects: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_wiki: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_pages: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_discussions: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub homepage: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub language: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub master_branch: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub archived: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub disabled: Option, - /// The repository visibility: public, private, or internal. - #[serde(skip_serializing_if="Option::is_none")] - pub visibility: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub mirror_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub open_issues: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub open_issues_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub permissions: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub temp_clone_token: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_merge_commit: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_squash_merge: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_rebase_merge: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub license: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub pushed_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub size: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub ssh_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub stargazers_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub svn_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub topics: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub watchers: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub watchers_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_forking: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub web_commit_signoff_required: Option, -} - #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct PullrequestHead { #[serde(skip_serializing_if="Option::is_none")] @@ -21417,282 +21737,11 @@ pub struct PullrequestHead { #[serde(skip_serializing_if="Option::is_none")] pub git_ref: Option, #[serde(skip_serializing_if="Option::is_none")] - pub repo: Option, + pub repo: Option, #[serde(skip_serializing_if="Option::is_none")] pub sha: Option, #[serde(skip_serializing_if="Option::is_none")] - pub user: Option, -} - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestHeadRepo { - #[serde(skip_serializing_if="Option::is_none")] - pub archive_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub assignees_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub blobs_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub branches_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub collaborators_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub comments_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub commits_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub compare_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub contents_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub contributors_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub deployments_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub downloads_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub fork: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub full_name: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_commits_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_refs_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_tags_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub hooks_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub html_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub node_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issue_comment_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issue_events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub issues_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub keys_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub labels_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub languages_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub merges_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub milestones_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub notifications_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub owner: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub private: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub pulls_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub releases_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub stargazers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub statuses_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscribers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscription_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub tags_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub teams_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub trees_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub clone_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub default_branch: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub forks_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub git_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_downloads: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_issues: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_projects: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_wiki: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_pages: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub has_discussions: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub homepage: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub language: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub master_branch: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub archived: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub disabled: Option, - /// The repository visibility: public, private, or internal. - #[serde(skip_serializing_if="Option::is_none")] - pub visibility: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub mirror_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub open_issues: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub open_issues_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub permissions: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub temp_clone_token: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_merge_commit: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_squash_merge: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_rebase_merge: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub license: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub pushed_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub size: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub ssh_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub stargazers_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub svn_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub topics: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub watchers: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub watchers_count: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if="Option::is_none")] - pub allow_forking: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub is_template: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub web_commit_signoff_required: Option, -} - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestHeadRepoLicense { - #[serde(skip_serializing_if="Option::is_none")] - pub key: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub spdx_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub node_id: Option, -} - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestHeadRepoOwner { - #[serde(skip_serializing_if="Option::is_none")] - pub avatar_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub followers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub following_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub gists_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub gravatar_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub html_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub node_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub login: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub organizations_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub received_events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub repos_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub site_admin: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub starred_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscriptions_url: Option, - #[serde(rename = "type")] - #[serde(skip_serializing_if="Option::is_none")] - pub _type: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub url: Option, -} - -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -pub struct PullrequestHeadUser { - #[serde(skip_serializing_if="Option::is_none")] - pub avatar_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub followers_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub following_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub gists_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub gravatar_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub html_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub node_id: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub login: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub organizations_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub received_events_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub repos_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub site_admin: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub starred_url: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub subscriptions_url: Option, - #[serde(rename = "type")] - #[serde(skip_serializing_if="Option::is_none")] - pub _type: Option, - #[serde(skip_serializing_if="Option::is_none")] - pub url: Option, + pub user: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -22030,7 +22079,7 @@ pub struct ReleaseAsset { #[serde(skip_serializing_if="Option::is_none")] pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] - pub uploader: Option, + pub uploader: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, } @@ -22935,7 +22984,7 @@ pub struct Repository10 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -23565,7 +23614,7 @@ pub struct Repository3 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -23785,7 +23834,7 @@ pub struct Repository4 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -24005,7 +24054,7 @@ pub struct Repository5 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -24225,7 +24274,7 @@ pub struct Repository6 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -24644,7 +24693,7 @@ pub struct Repository8 { pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -25250,7 +25299,106 @@ pub struct RepositoryLite1 { #[serde(skip_serializing_if="Option::is_none")] pub notifications_url: Option, #[serde(skip_serializing_if="Option::is_none")] - pub owner: Option, + pub owner: Option, + /// Whether the repository is private or public. + #[serde(skip_serializing_if="Option::is_none")] + pub private: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub pulls_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub releases_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub stargazers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub statuses_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscribers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscription_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub tags_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub teams_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub trees_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub url: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct RepositoryLite2 { + #[serde(skip_serializing_if="Option::is_none")] + pub archive_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub assignees_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub blobs_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub branches_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub collaborators_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub comments_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub commits_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub compare_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub contents_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub contributors_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub deployments_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub downloads_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub fork: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub forks_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub full_name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub git_commits_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub git_refs_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub git_tags_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub hooks_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub html_url: Option, + /// Unique identifier of the repository + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub issue_comment_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub issue_events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub issues_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub keys_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub labels_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub languages_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub merges_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub milestones_url: Option, + /// The name of the repository. + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub node_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub notifications_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub owner: Option, /// Whether the repository is private or public. #[serde(skip_serializing_if="Option::is_none")] pub private: Option, @@ -25579,6 +25727,20 @@ pub struct RepositoryRuleParamsCodeScanningTool { pub tool: Option, } +/// A reviewing team, and file patterns describing which files they must approve changes to. +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct RepositoryRuleParamsRequiredReviewerConfiguration { + /// Array of file patterns. Pull requests which change matching files must be approved by the specified team. File patterns use the same syntax as `.gitignore` files. + #[serde(skip_serializing_if="Option::is_none")] + pub file_patterns: Option>, + /// Minimum number of approvals required from the specified team. If set to zero, the team will be added to the pull request but approval is optional. + #[serde(skip_serializing_if="Option::is_none")] + pub minimum_approvals: Option, + /// Node ID of the team which must review changes to matching files. + #[serde(skip_serializing_if="Option::is_none")] + pub reviewer_id: Option, +} + /// Restricted commit #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct RepositoryRuleParamsRestrictedCommits { @@ -25892,7 +26054,7 @@ pub struct RepositoryVulnerabilityAlertAlert1 { #[serde(skip_serializing_if="Option::is_none")] pub dismissed_at: Option, #[serde(skip_serializing_if="Option::is_none")] - pub dismisser: Option, + pub dismisser: Option, #[serde(skip_serializing_if="Option::is_none")] pub external_identifier: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -26110,7 +26272,7 @@ pub struct RepositoryWebhooks { /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. #[serde(skip_serializing_if="Option::is_none")] pub allow_update_branch: Option, - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. #[serde(skip_serializing_if="Option::is_none")] pub use_squash_pr_title_as_default: Option, /// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). @@ -26765,7 +26927,7 @@ pub struct ReposownerrepobranchesbranchprotectionRequiredStatusChecks { /// Require branches to be up to date before merging. #[serde(skip_serializing_if="Option::is_none")] pub strict: Option, - /// **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + /// **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. #[serde(skip_serializing_if="Option::is_none")] pub contexts: Option>, /// The list of status checks to require in order to merge into this branch. @@ -27626,6 +27788,12 @@ pub struct SecretScanningAlert { /// The token status as of the latest validity check. #[serde(skip_serializing_if="Option::is_none")] pub validity: Option, + /// Whether the detected secret was publicly leaked. + #[serde(skip_serializing_if="Option::is_none")] + pub publicly_leaked: Option, + /// Whether the detected secret was found in multiple repositories under the same organization or enterprise. + #[serde(skip_serializing_if="Option::is_none")] + pub multi_repo: Option, } /// **Required when the `state` is `resolved`.** The reason for resolving the alert. @@ -27801,6 +27969,12 @@ pub struct SecretScanningAlertWebhook { /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. #[serde(skip_serializing_if="Option::is_none")] pub push_protection_bypassed_at: Option>, + /// Whether the detected secret was publicly leaked. + #[serde(skip_serializing_if="Option::is_none")] + pub publicly_leaked: Option, + /// Whether the detected secret was found in multiple repositories in the same organization or business. + #[serde(skip_serializing_if="Option::is_none")] + pub multi_repo: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -28575,7 +28749,7 @@ pub struct SimplePullRequest { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -28652,7 +28826,7 @@ pub struct SimplePullRequest1 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -28744,7 +28918,7 @@ pub struct SimplePullRequest2 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -28821,7 +28995,7 @@ pub struct SimplePullRequest3 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -28928,7 +29102,7 @@ pub struct SimplePullRequest4 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -29184,6 +29358,8 @@ pub struct SimpleUser { pub site_admin: Option, #[serde(skip_serializing_if="Option::is_none")] pub starred_at: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// Create a new snapshot of a repository's dependencies. @@ -30666,6 +30842,8 @@ pub struct User { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -30713,6 +30891,8 @@ pub struct User1 { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -30760,6 +30940,8 @@ pub struct User2 { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -30807,6 +30989,8 @@ pub struct User3 { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -30903,6 +31087,151 @@ pub struct User5 { pub url: Option, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct User6 { + #[serde(skip_serializing_if="Option::is_none")] + pub avatar_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub deleted: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub followers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub following_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gists_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gravatar_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub html_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub login: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub node_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub organizations_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub received_events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repos_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub starred_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscriptions_url: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct User7 { + #[serde(skip_serializing_if="Option::is_none")] + pub avatar_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub deleted: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub followers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub following_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gists_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gravatar_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub html_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub login: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub node_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub organizations_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub received_events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repos_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub starred_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscriptions_url: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub url: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct User8 { + #[serde(skip_serializing_if="Option::is_none")] + pub avatar_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub deleted: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub followers_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub following_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gists_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub gravatar_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub html_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub login: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub node_id: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub organizations_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub received_events_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repos_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub site_admin: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub starred_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub subscriptions_url: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub url: Option, +} + /// User Marketplace Purchase #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct UserMarketplacePurchase { @@ -30970,6 +31299,8 @@ pub struct UserRoleAssignment { pub site_admin: Option, #[serde(skip_serializing_if="Option::is_none")] pub starred_at: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// User Search Result Item @@ -31044,6 +31375,8 @@ pub struct UserSearchResultItem { pub company: Option, #[serde(skip_serializing_if="Option::is_none")] pub suspended_at: Option>, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// Pull request number for this codespace @@ -35429,6 +35762,24 @@ pub struct WebhookSecretScanningAlertLocationCreatedFormEncoded { pub payload: Option, } +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +pub struct WebhookSecretScanningAlertPubliclyLeaked { + #[serde(skip_serializing_if="Option::is_none")] + pub action: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub alert: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub enterprise: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub installation: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub organization: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub repository: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub sender: Option, +} + #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct WebhookSecretScanningAlertReopened { #[serde(skip_serializing_if="Option::is_none")] @@ -36705,7 +37056,7 @@ pub struct WebhookdeploymentreviewrejectedWorkflowJobRuns { #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct WebhookdeploymentreviewrequestedReviewers { #[serde(skip_serializing_if="Option::is_none")] - pub reviewer: Option, + pub reviewer: Option, #[serde(rename = "type")] #[serde(skip_serializing_if="Option::is_none")] pub _type: Option, @@ -36955,6 +37306,8 @@ pub struct WebhookinstallationtargetrenamedAccount { pub url: Option, #[serde(skip_serializing_if="Option::is_none")] pub website_url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -37763,7 +38116,7 @@ pub struct WebhookpullrequestreviewcommentcreatedPullRequest { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -37855,7 +38208,7 @@ pub struct WebhookpullrequestreviewcommentdeletedPullRequest { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -37997,7 +38350,7 @@ pub struct WebhookpullrequestreviewcommenteditedPullRequest { #[serde(skip_serializing_if="Option::is_none")] pub url: Option, #[serde(skip_serializing_if="Option::is_none")] - pub user: Option, + pub user: Option, } /// The review that was affected. @@ -38120,6 +38473,8 @@ pub struct WebhookregistrypackagepublishedRegistryPackageOwner { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -38630,7 +38985,7 @@ pub struct WebhooksAlert { #[serde(skip_serializing_if="Option::is_none")] pub dismissed_at: Option, #[serde(skip_serializing_if="Option::is_none")] - pub dismisser: Option, + pub dismisser: Option, #[serde(skip_serializing_if="Option::is_none")] pub external_identifier: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -38725,6 +39080,8 @@ pub struct WebhooksApprover { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// The changes to the comment. @@ -38815,6 +39172,8 @@ pub struct WebhooksDeployKey { pub url: Option, #[serde(skip_serializing_if="Option::is_none")] pub verified: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub enabled: Option, } /// The pusher type for the event. Can be either `user` or a deploy key. @@ -39346,7 +39705,7 @@ pub struct WebhooksPullRequest5 { #[serde(skip_serializing_if="Option::is_none")] pub assignee: Option, #[serde(skip_serializing_if="Option::is_none")] - pub assignees: Option>, + pub assignees: Option>, /// How the author is associated with the repository. #[serde(skip_serializing_if="Option::is_none")] pub author_association: Option, @@ -40019,6 +40378,8 @@ pub struct WebhooksSponsorshipMaintainer { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } /// Groups of organization members that gives permissions on specified repositories. @@ -40177,6 +40538,8 @@ pub struct WebhooksUser { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -40224,6 +40587,8 @@ pub struct WebhooksUserMannequin { pub _type: Option, #[serde(skip_serializing_if="Option::is_none")] pub url: Option, + #[serde(skip_serializing_if="Option::is_none")] + pub user_view_type: Option, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -40347,13 +40712,13 @@ pub struct WebhookstatusCommit { #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct WebhookstatusCommit1 { #[serde(skip_serializing_if="Option::is_none")] - pub author: Option, + pub author: Option, #[serde(skip_serializing_if="Option::is_none")] pub comments_url: Option, #[serde(skip_serializing_if="Option::is_none")] pub commit: Option, #[serde(skip_serializing_if="Option::is_none")] - pub committer: Option, + pub committer: Option, #[serde(skip_serializing_if="Option::is_none")] pub html_url: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -40699,7 +41064,7 @@ pub struct WorkflowRun { #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct WorkflowRun1 { #[serde(skip_serializing_if="Option::is_none")] - pub actor: Option, + pub actor: Option, #[serde(skip_serializing_if="Option::is_none")] pub artifacts_url: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -40745,7 +41110,7 @@ pub struct WorkflowRun1 { #[serde(skip_serializing_if="Option::is_none")] pub referenced_workflows: Option>, #[serde(skip_serializing_if="Option::is_none")] - pub repository: Option, + pub repository: Option, #[serde(skip_serializing_if="Option::is_none")] pub rerun_url: Option, #[serde(skip_serializing_if="Option::is_none")] @@ -40757,7 +41122,7 @@ pub struct WorkflowRun1 { #[serde(skip_serializing_if="Option::is_none")] pub status: Option, #[serde(skip_serializing_if="Option::is_none")] - pub triggering_actor: Option, + pub triggering_actor: Option, #[serde(skip_serializing_if="Option::is_none")] pub updated_at: Option>, #[serde(skip_serializing_if="Option::is_none")]