Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Update rule evaluation classes and enums in GitHub API with new Bypass value #37

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libs/GitHub/Generated/GitHub.Models.RuleSuite2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public sealed partial class RuleSuite2
public global::GitHub.RuleSuiteResult2? Result { get; set; }

/// <summary>
/// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`.
/// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("evaluation_result")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.RuleSuiteEvaluationResult2JsonConverter))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public enum RuleSuiteEvaluationResult
///
/// </summary>
Fail,
/// <summary>
///
/// </summary>
Bypass,
}

/// <summary>
Expand All @@ -32,6 +36,7 @@ public static string ToValueString(this RuleSuiteEvaluationResult value)
{
RuleSuiteEvaluationResult.Pass => "pass",
RuleSuiteEvaluationResult.Fail => "fail",
RuleSuiteEvaluationResult.Bypass => "bypass",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -44,6 +49,7 @@ public static string ToValueString(this RuleSuiteEvaluationResult value)
{
"pass" => RuleSuiteEvaluationResult.Pass,
"fail" => RuleSuiteEvaluationResult.Fail,
"bypass" => RuleSuiteEvaluationResult.Bypass,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace GitHub
{
/// <summary>
/// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`.
/// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run.
/// </summary>
public enum RuleSuiteEvaluationResult2
{
Expand All @@ -16,6 +16,10 @@ public enum RuleSuiteEvaluationResult2
///
/// </summary>
Fail,
/// <summary>
///
/// </summary>
Bypass,
}

/// <summary>
Expand All @@ -32,6 +36,7 @@ public static string ToValueString(this RuleSuiteEvaluationResult2 value)
{
RuleSuiteEvaluationResult2.Pass => "pass",
RuleSuiteEvaluationResult2.Fail => "fail",
RuleSuiteEvaluationResult2.Bypass => "bypass",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -44,6 +49,7 @@ public static string ToValueString(this RuleSuiteEvaluationResult2 value)
{
"pass" => RuleSuiteEvaluationResult2.Pass,
"fail" => RuleSuiteEvaluationResult2.Fail,
"bypass" => RuleSuiteEvaluationResult2.Bypass,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public sealed partial class RuleSuiteRuleEvaluation
public string? RuleType { get; set; }

/// <summary>
/// Any associated details with the rule evaluation.
/// The detailed failure message for the rule. Null if the rule passed.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("details")]
public string? Details { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ partial void ProcessOrgsEnableOrDisableSecurityProductOnAllOrgReposResponse(
/// &gt; **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/).<br/>
/// 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)."<br/>
/// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.<br/>
/// OAuth app tokens and personal access tokens (classic) need the `write:org` scope 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.
/// </summary>
/// <param name="org"></param>
/// <param name="securityProduct"></param>
Expand Down Expand Up @@ -96,7 +96,7 @@ partial void ProcessOrgsEnableOrDisableSecurityProductOnAllOrgReposResponse(
/// &gt; **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/).<br/>
/// 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)."<br/>
/// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.<br/>
/// OAuth app tokens and personal access tokens (classic) need the `write:org` scope 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.
/// </summary>
/// <param name="org"></param>
/// <param name="securityProduct"></param>
Expand Down
18 changes: 15 additions & 3 deletions src/libs/GitHub/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14929,7 +14929,7 @@ paths:

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 `write:org` scope 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.
tags:
- orgs
operationId: orgs/enable-or-disable-security-product-on-all-org-repos
Expand Down Expand Up @@ -74806,6 +74806,7 @@ components:
enum:
- pass
- fail
- bypass
description: The result of the rule evaluations for rules with the `active`
and `evaluate` enforcement statuses, demonstrating whether rules would
pass or fail if all rules in the rule suite were `active`.
Expand Down Expand Up @@ -74854,12 +74855,15 @@ components:
enforcement status.
evaluation_result:
type: string
nullable: true
enum:
- pass
- fail
- bypass
description: The result of the rule evaluations for rules with the `active`
and `evaluate` enforcement statuses, demonstrating whether rules would
pass or fail if all rules in the rule suite were `active`.
pass or fail if all rules in the rule suite were `active`. Null if no
rules with `evaluate` enforcement status were run.
rule_evaluations:
type: array
description: Details on the evaluated rules.
Expand Down Expand Up @@ -74898,7 +74902,9 @@ components:
description: The type of rule.
details:
type: string
description: Any associated details with the rule evaluation.
nullable: true
description: The detailed failure message for the rule. Null if the
rule passed.
repository-advisory-vulnerability:
description: A product affected by the vulnerability detailed in a repository
security advisory.
Expand Down Expand Up @@ -198979,6 +198985,7 @@ components:
secret_scanning: enabled
secret_scanning_push_protection: enabled
secret_scanning_validity_checks: enabled
secret_scanning_non_provider_patterns: enabled
private_vulnerability_reporting: enabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/17
Expand All @@ -199001,6 +199008,7 @@ components:
secret_scanning: enabled
secret_scanning_push_protection: enabled
secret_scanning_validity_checks: disabled
secret_scanning_non_provider_patterns: disabled
private_vulnerability_reporting: enabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/1326
Expand All @@ -199024,6 +199032,7 @@ components:
secret_scanning: enabled
secret_scanning_push_protection: disabled
secret_scanning_validity_checks: disabled
secret_scanning_non_provider_patterns: disabled
private_vulnerability_reporting: disabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/1325
Expand All @@ -199049,6 +199058,7 @@ components:
secret_scanning: enabled
secret_scanning_push_protection: enabled
secret_scanning_validity_checks: enabled
secret_scanning_non_provider_patterns: enabled
private_vulnerability_reporting: enabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/1325
Expand Down Expand Up @@ -199096,6 +199106,7 @@ components:
secret_scanning: disabled
secret_scanning_push_protection: disabled
secret_scanning_validity_checks: disabled
secret_scanning_non_provider_patterns: disabled
private_vulnerability_reporting: disabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/1325
Expand Down Expand Up @@ -206554,6 +206565,7 @@ components:
secret_scanning: enabled
secret_scanning_push_protection: disabled
secret_scanning_validity_checks: disabled
secret_scanning_non_provider_patterns: disabled
private_vulnerability_reporting: disabled
enforcement: enforced
url: https://api.github.com/orgs/octo-org/code-security/configurations/1325
Expand Down
Loading