-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] Add Advanced Security Properties to Repository Get/Update (#2865)
* add SecurityAndAnalysis to repository get/update * add repository advanced security * cleanup --------- Co-authored-by: Dirty Gooback <19241000+dirtygooback@users.noreply.github.com> Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
- Loading branch information
1 parent
bdc1694
commit b208057
Showing
5 changed files
with
379 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Octokit.Internal; | ||
|
||
namespace Octokit | ||
{ | ||
public enum Status | ||
{ | ||
[Parameter(Value = "enabled")] | ||
Enabled, | ||
[Parameter(Value = "disabled")] | ||
Disabled | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
using Octokit.Internal; | ||
using System.Diagnostics; | ||
|
||
|
||
namespace Octokit | ||
{ | ||
/// <summary> | ||
/// The security and analysis features that are enabled or disabled for the repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class SecurityAndAnalysisRequest | ||
{ | ||
public SecurityAndAnalysisRequest() | ||
{ } | ||
|
||
public SecurityAndAnalysisRequest(AdvancedSecurityRequest advancedSecurity, DependabotSecurityUpdatesRequest dependabotSecurityUpdates, | ||
SecretScanningRequest secretScanning, SecretScanningPushProtectionRequest secretScanningPushProtection, | ||
SecretScanningValidityChecksRequest secretScanningValidityChecks) | ||
{ | ||
this.AdvancedSecurity = advancedSecurity; | ||
this.DependabotSecurityUpdates = dependabotSecurityUpdates; | ||
this.SecretScanning = secretScanning; | ||
this.SecretScanningPushProtection = secretScanningPushProtection; | ||
this.SecretScanningValidityChecks = secretScanningValidityChecks; | ||
} | ||
|
||
|
||
public AdvancedSecurityRequest AdvancedSecurity { get; set; } | ||
public DependabotSecurityUpdatesRequest DependabotSecurityUpdates { get; set; } | ||
public SecretScanningRequest SecretScanning { get; set; } | ||
public SecretScanningPushProtectionRequest SecretScanningPushProtection { get; set; } | ||
public SecretScanningValidityChecksRequest SecretScanningValidityChecks { get; set; } | ||
|
||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Use the status property to enable or disable GitHub Advanced Security for this repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class AdvancedSecurityRequest | ||
{ | ||
public AdvancedSecurityRequest() | ||
{ } | ||
|
||
public AdvancedSecurityRequest(Status? status) | ||
{ | ||
this.Status = status; | ||
} | ||
|
||
/// <summary> | ||
/// Can be enabled, disabled, or null | ||
/// </summary> | ||
public Status? Status { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Use the status property to enable or disable Dependabot security updates for this repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class DependabotSecurityUpdatesRequest | ||
{ | ||
public DependabotSecurityUpdatesRequest() | ||
{ } | ||
|
||
public DependabotSecurityUpdatesRequest(Status? status) | ||
{ | ||
this.Status = status; | ||
} | ||
|
||
/// <summary> | ||
/// Can be enabled, disabled, or null | ||
/// </summary> | ||
public Status? Status { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Use the status property to enable or disable secret scanning for this repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class SecretScanningRequest | ||
{ | ||
public SecretScanningRequest() | ||
{ } | ||
|
||
public SecretScanningRequest(Status? status) | ||
{ | ||
this.Status = status; | ||
} | ||
|
||
/// <summary> | ||
/// Can be enabled, disabled, or null | ||
/// </summary> | ||
public Status? Status { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Use the status property to enable or disable secret scanning push protection for this repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class SecretScanningPushProtectionRequest | ||
{ | ||
public SecretScanningPushProtectionRequest() | ||
{ } | ||
|
||
public SecretScanningPushProtectionRequest(Status? status) | ||
{ | ||
this.Status = status; | ||
} | ||
|
||
/// <summary> | ||
/// Can be enabled, disabled, or null | ||
/// </summary> | ||
public Status? Status { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Use the status property to enable or disable secret scanning validity checks for this repository | ||
/// </summary> | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class SecretScanningValidityChecksRequest | ||
{ | ||
public SecretScanningValidityChecksRequest() | ||
{ } | ||
|
||
public SecretScanningValidityChecksRequest(Status? status) | ||
{ | ||
this.Status = status; | ||
} | ||
|
||
/// <summary> | ||
/// Can be enabled, disabled, or null | ||
/// </summary> | ||
public Status? Status { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return new SimpleJsonSerializer().Serialize(this); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.