diff --git a/Octokit/Models/Common/Status.cs b/Octokit/Models/Common/Status.cs
new file mode 100644
index 00000000..94a80c94
--- /dev/null
+++ b/Octokit/Models/Common/Status.cs
@@ -0,0 +1,12 @@
+using Octokit.Internal;
+
+namespace Octokit
+{
+ public enum Status
+ {
+ [Parameter(Value = "enabled")]
+ Enabled,
+ [Parameter(Value = "disabled")]
+ Disabled
+ }
+}
diff --git a/Octokit/Models/Request/RepositoryUpdate.cs b/Octokit/Models/Request/RepositoryUpdate.cs
index b8a3c9c2..16e53b26 100644
--- a/Octokit/Models/Request/RepositoryUpdate.cs
+++ b/Octokit/Models/Request/RepositoryUpdate.cs
@@ -1,4 +1,5 @@
using Octokit.Internal;
+using Octokit.Models.Response;
using System;
using System.Diagnostics;
@@ -133,6 +134,8 @@ namespace Octokit
///
public bool? HasDiscussions { get; set; }
+ public SecurityAndAnalysisRequest SecurityAndAnalysis { get; set; }
+
internal string DebuggerDisplay => new SimpleJsonSerializer().Serialize(this);
}
}
diff --git a/Octokit/Models/Request/SecurityAndAnalysisRequest.cs b/Octokit/Models/Request/SecurityAndAnalysisRequest.cs
new file mode 100644
index 00000000..38705d4a
--- /dev/null
+++ b/Octokit/Models/Request/SecurityAndAnalysisRequest.cs
@@ -0,0 +1,184 @@
+using Octokit.Internal;
+using System.Diagnostics;
+
+
+namespace Octokit
+{
+ ///
+ /// The security and analysis features that are enabled or disabled for the repository
+ ///
+ [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);
+ }
+ }
+ }
+
+
+ ///
+ /// Use the status property to enable or disable GitHub Advanced Security for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class AdvancedSecurityRequest
+ {
+ public AdvancedSecurityRequest()
+ { }
+
+ public AdvancedSecurityRequest(Status? status)
+ {
+ this.Status = status;
+ }
+
+ ///
+ /// Can be enabled, disabled, or null
+ ///
+ public Status? Status { get; set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable Dependabot security updates for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class DependabotSecurityUpdatesRequest
+ {
+ public DependabotSecurityUpdatesRequest()
+ { }
+
+ public DependabotSecurityUpdatesRequest(Status? status)
+ {
+ this.Status = status;
+ }
+
+ ///
+ /// Can be enabled, disabled, or null
+ ///
+ public Status? Status { get; set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanningRequest
+ {
+ public SecretScanningRequest()
+ { }
+
+ public SecretScanningRequest(Status? status)
+ {
+ this.Status = status;
+ }
+
+ ///
+ /// Can be enabled, disabled, or null
+ ///
+ public Status? Status { get; set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning push protection for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanningPushProtectionRequest
+ {
+ public SecretScanningPushProtectionRequest()
+ { }
+
+ public SecretScanningPushProtectionRequest(Status? status)
+ {
+ this.Status = status;
+ }
+
+ ///
+ /// Can be enabled, disabled, or null
+ ///
+ public Status? Status { get; set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning validity checks for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanningValidityChecksRequest
+ {
+ public SecretScanningValidityChecksRequest()
+ { }
+
+ public SecretScanningValidityChecksRequest(Status? status)
+ {
+ this.Status = status;
+ }
+
+ ///
+ /// Can be enabled, disabled, or null
+ ///
+ public Status? Status { get; set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+}
diff --git a/Octokit/Models/Response/Repository.cs b/Octokit/Models/Response/Repository.cs
index 7075c302..5ec70a9a 100644
--- a/Octokit/Models/Response/Repository.cs
+++ b/Octokit/Models/Response/Repository.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
@@ -17,7 +16,7 @@ namespace Octokit
Id = id;
}
- public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, string sshUrl, string svnUrl, string mirrorUrl, string archiveUrl, long id, string nodeId, User owner, string name, string fullName, bool isTemplate, string description, string homepage, string language, bool @private, bool fork, int forksCount, int stargazersCount, string defaultBranch, int openIssuesCount, DateTimeOffset? pushedAt, DateTimeOffset createdAt, DateTimeOffset updatedAt, RepositoryPermissions permissions, Repository parent, Repository source, LicenseMetadata license, bool hasDiscussions, bool hasIssues, bool hasWiki, bool hasDownloads, bool hasPages, int subscribersCount, long size, bool? allowRebaseMerge, bool? allowSquashMerge, bool? allowMergeCommit, bool archived, int watchersCount, bool? deleteBranchOnMerge, RepositoryVisibility visibility, IEnumerable topics, bool? allowAutoMerge, bool? allowUpdateBranch, bool? webCommitSignoffRequired, IReadOnlyDictionary customProperties)
+ public Repository(string url, string htmlUrl, string cloneUrl, string gitUrl, string sshUrl, string svnUrl, string mirrorUrl, string archiveUrl, long id, string nodeId, User owner, string name, string fullName, bool isTemplate, string description, string homepage, string language, bool @private, bool fork, int forksCount, int stargazersCount, string defaultBranch, int openIssuesCount, DateTimeOffset? pushedAt, DateTimeOffset createdAt, DateTimeOffset updatedAt, RepositoryPermissions permissions, Repository parent, Repository source, LicenseMetadata license, bool hasDiscussions, bool hasIssues, bool hasWiki, bool hasDownloads, bool hasPages, int subscribersCount, long size, bool? allowRebaseMerge, bool? allowSquashMerge, bool? allowMergeCommit, bool archived, int watchersCount, bool? deleteBranchOnMerge, RepositoryVisibility visibility, IEnumerable topics, bool? allowAutoMerge, bool? allowUpdateBranch, bool? webCommitSignoffRequired, SecurityAndAnalysis securityAndAnalysis)
{
Url = url;
HtmlUrl = htmlUrl;
@@ -69,7 +68,7 @@ namespace Octokit
AllowAutoMerge = allowAutoMerge;
AllowUpdateBranch = allowUpdateBranch;
WebCommitSignoffRequired = webCommitSignoffRequired;
- CustomProperties = customProperties;
+ SecurityAndAnalysis = securityAndAnalysis;
}
public string Url { get; private set; }
@@ -171,7 +170,7 @@ namespace Octokit
public bool? WebCommitSignoffRequired { get; private set; }
- public IReadOnlyDictionary CustomProperties { get; private set; }
+ public SecurityAndAnalysis SecurityAndAnalysis { get; private set;}
internal string DebuggerDisplay
{
diff --git a/Octokit/Models/Response/SecurityAndAnalysis.cs b/Octokit/Models/Response/SecurityAndAnalysis.cs
new file mode 100644
index 00000000..594e462d
--- /dev/null
+++ b/Octokit/Models/Response/SecurityAndAnalysis.cs
@@ -0,0 +1,177 @@
+using Octokit.Internal;
+using System.Diagnostics;
+
+
+namespace Octokit
+{
+ ///
+ /// The security and analysis features that are enabled or disabled for the repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecurityAndAnalysis
+ {
+ public SecurityAndAnalysis()
+ { }
+
+ public SecurityAndAnalysis(AdvancedSecurity advancedSecurity, DependabotSecurityUpdates dependabotSecurityUpdates, SecretScanning secretScanning, SecretScanningPushProtection secretScanningPushProtection, SecretScanningValidityChecks secretScanningValidityChecks)
+ {
+ this.AdvancedSecurity = advancedSecurity;
+ this.DependabotSecurityUpdates = dependabotSecurityUpdates;
+ this.SecretScanning = secretScanning;
+ this.SecretScanningPushProtection = secretScanningPushProtection;
+ this.SecretScanningValidityChecks = secretScanningValidityChecks;
+ }
+
+
+ public AdvancedSecurity AdvancedSecurity { get; protected set; }
+
+ public DependabotSecurityUpdates DependabotSecurityUpdates { get; protected set; }
+
+ public SecretScanning SecretScanning { get; protected set; }
+
+ public SecretScanningPushProtection SecretScanningPushProtection { get; protected set; }
+
+ public SecretScanningValidityChecks SecretScanningValidityChecks { get; protected set; }
+
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+
+ ///
+ /// Use the status property to enable or disable GitHub Advanced Security for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class AdvancedSecurity
+ {
+ public AdvancedSecurity()
+ { }
+
+ public AdvancedSecurity(string status)
+ {
+ this.Status = status;
+ }
+
+
+ public string Status { get; protected set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable Dependabot security updates for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class DependabotSecurityUpdates
+ {
+ public DependabotSecurityUpdates()
+ { }
+
+ public DependabotSecurityUpdates(string status)
+ {
+ this.Status = status;
+ }
+
+
+ public string Status { get; protected set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanning
+ {
+ public SecretScanning()
+ { }
+
+ public SecretScanning(string status)
+ {
+ this.Status = status;
+ }
+
+
+ public string Status { get; protected set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning push protection for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanningPushProtection
+ {
+ public SecretScanningPushProtection()
+ { }
+
+ public SecretScanningPushProtection(string status)
+ {
+ this.Status = status;
+ }
+
+
+ public string Status { get; protected set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+ ///
+ /// Use the status property to enable or disable secret scanning validity checks for this repository
+ ///
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class SecretScanningValidityChecks
+ {
+ public SecretScanningValidityChecks()
+ { }
+
+ public SecretScanningValidityChecks(string status)
+ {
+ this.Status = status;
+ }
+
+
+ public string Status { get; protected set; }
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return new SimpleJsonSerializer().Serialize(this);
+ }
+ }
+ }
+
+}