diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index b67fdd0cef..df54e2b020 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -1038,7 +1038,26 @@ public enum Components { /// Feature options for code scanning /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. - public var codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? + public struct CodeScanningOptionsPayload: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptionsPayload`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } + /// Feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. @@ -1326,7 +1345,7 @@ public enum Components { dependencyGraphAutosubmitActionOptions: Components.Schemas.CodeSecurityConfiguration.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Components.Schemas.CodeSecurityConfiguration.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? = nil, - codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? = nil, + codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? = nil, codeScanningDefaultSetup: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupOptionsPayload? = nil, codeScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -1405,6 +1424,25 @@ public enum Components { case updatedAt = "updated_at" } } + /// Security Configuration feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options`. + public struct CodeScanningOptions: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptions`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } /// Feature options for code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options`. @@ -2517,6 +2555,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -2662,6 +2702,7 @@ public enum Operations { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal @@ -2684,6 +2725,7 @@ public enum Operations { dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -2706,6 +2748,7 @@ public enum Operations { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal @@ -2729,6 +2772,7 @@ public enum Operations { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" @@ -2780,6 +2824,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -2838,6 +2886,7 @@ public enum Operations { "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", @@ -5429,6 +5478,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -5647,6 +5698,7 @@ public enum Operations { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal @@ -5671,6 +5723,7 @@ public enum Operations { dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -5695,6 +5748,7 @@ public enum Operations { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal @@ -5720,6 +5774,7 @@ public enum Operations { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" @@ -5773,6 +5828,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -5839,6 +5898,7 @@ public enum Operations { "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 652329b744..55c32bf47b 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -3854,11 +3854,11 @@ public struct Client: APIProtocol { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 82e1494a66..1a4b16a734 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -337,11 +337,11 @@ public protocol APIProtocol: Sendable { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -1057,11 +1057,11 @@ extension APIProtocol { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -16167,11 +16167,11 @@ public enum Operations { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 96f26d47f0..48220a69a0 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -449,6 +449,11 @@ public enum Components { case dockerRegistry = "docker_registry" case gitSource = "git_source" case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -529,6 +534,11 @@ public enum Components { case dockerRegistry = "docker_registry" case gitSource = "git_source" case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -1051,6 +1061,11 @@ public enum Operations { case dockerRegistry = "docker_registry" case gitSource = "git_source" case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -1711,6 +1726,11 @@ public enum Operations { case dockerRegistry = "docker_registry" case gitSource = "git_source" case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index a60d082e3c..9b9e54eeb4 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -13512,6 +13512,223 @@ public enum Components { case updatedAt = "updated_at" } } + /// A repository rule. + /// + /// - Remark: Generated from `#/components/schemas/org-rules`. + @frozen public enum OrgRules: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-rules/case1`. + case RepositoryRuleCreation(Components.Schemas.RepositoryRuleCreation) + /// - Remark: Generated from `#/components/schemas/org-rules/case2`. + case RepositoryRuleUpdate(Components.Schemas.RepositoryRuleUpdate) + /// - Remark: Generated from `#/components/schemas/org-rules/case3`. + case RepositoryRuleDeletion(Components.Schemas.RepositoryRuleDeletion) + /// - Remark: Generated from `#/components/schemas/org-rules/case4`. + case RepositoryRuleRequiredLinearHistory(Components.Schemas.RepositoryRuleRequiredLinearHistory) + /// - Remark: Generated from `#/components/schemas/org-rules/case5`. + case RepositoryRuleRequiredDeployments(Components.Schemas.RepositoryRuleRequiredDeployments) + /// - Remark: Generated from `#/components/schemas/org-rules/case6`. + case RepositoryRuleRequiredSignatures(Components.Schemas.RepositoryRuleRequiredSignatures) + /// - Remark: Generated from `#/components/schemas/org-rules/case7`. + case RepositoryRulePullRequest(Components.Schemas.RepositoryRulePullRequest) + /// - Remark: Generated from `#/components/schemas/org-rules/case8`. + case RepositoryRuleRequiredStatusChecks(Components.Schemas.RepositoryRuleRequiredStatusChecks) + /// - Remark: Generated from `#/components/schemas/org-rules/case9`. + case RepositoryRuleNonFastForward(Components.Schemas.RepositoryRuleNonFastForward) + /// - Remark: Generated from `#/components/schemas/org-rules/case10`. + case RepositoryRuleCommitMessagePattern(Components.Schemas.RepositoryRuleCommitMessagePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case11`. + case RepositoryRuleCommitAuthorEmailPattern(Components.Schemas.RepositoryRuleCommitAuthorEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case12`. + case RepositoryRuleCommitterEmailPattern(Components.Schemas.RepositoryRuleCommitterEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case13`. + case RepositoryRuleBranchNamePattern(Components.Schemas.RepositoryRuleBranchNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case14`. + case RepositoryRuleTagNamePattern(Components.Schemas.RepositoryRuleTagNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case15`. + case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case16`. + case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) + /// - Remark: Generated from `#/components/schemas/org-rules/case17`. + case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case18`. + case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) + /// - Remark: Generated from `#/components/schemas/org-rules/case19`. + case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) + /// - Remark: Generated from `#/components/schemas/org-rules/case20`. + case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .RepositoryRuleCreation(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleUpdate(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleDeletion(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredLinearHistory(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredDeployments(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredSignatures(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRulePullRequest(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredStatusChecks(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleNonFastForward(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitMessagePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitAuthorEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitterEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleBranchNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleTagNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFilePathRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFilePathLength(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFileExtensionRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFileSize(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleWorkflows(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCodeScanning(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .RepositoryRuleCreation(value): + try value.encode(to: encoder) + case let .RepositoryRuleUpdate(value): + try value.encode(to: encoder) + case let .RepositoryRuleDeletion(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredLinearHistory(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredDeployments(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredSignatures(value): + try value.encode(to: encoder) + case let .RepositoryRulePullRequest(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredStatusChecks(value): + try value.encode(to: encoder) + case let .RepositoryRuleNonFastForward(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitMessagePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitAuthorEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitterEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleBranchNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleTagNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleFilePathRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFilePathLength(value): + try value.encode(to: encoder) + case let .RepositoryRuleFileExtensionRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFileSize(value): + try value.encode(to: encoder) + case let .RepositoryRuleWorkflows(value): + try value.encode(to: encoder) + case let .RepositoryRuleCodeScanning(value): + try value.encode(to: encoder) + } + } + } /// - Remark: Generated from `#/components/schemas/RuleSuites`. public struct RuleSuitesPayload: Codable, Hashable, Sendable { /// The unique identifier of the rule insight. @@ -20302,7 +20519,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/deploy-key/added_by`. public var addedBy: Swift.String? /// - Remark: Generated from `#/components/schemas/deploy-key/last_used`. - public var lastUsed: Swift.String? + public var lastUsed: Foundation.Date? /// - Remark: Generated from `#/components/schemas/deploy-key/enabled`. public var enabled: Swift.Bool? /// Creates a new `DeployKey`. @@ -20327,7 +20544,7 @@ public enum Components { createdAt: Swift.String, readOnly: Swift.Bool, addedBy: Swift.String? = nil, - lastUsed: Swift.String? = nil, + lastUsed: Foundation.Date? = nil, enabled: Swift.Bool? = nil ) { self.id = id @@ -24413,7 +24630,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -24429,7 +24646,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target @@ -25311,7 +25528,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -25327,7 +25544,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement? = nil, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index f37397da92..4255294521 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -2631,6 +2631,8 @@ public enum Components { public var verified: Swift.Bool /// - Remark: Generated from `#/components/schemas/key/read_only`. public var readOnly: Swift.Bool + /// - Remark: Generated from `#/components/schemas/key/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `Key`. /// /// - Parameters: @@ -2641,6 +2643,7 @@ public enum Components { /// - createdAt: /// - verified: /// - readOnly: + /// - lastUsed: public init( key: Swift.String, id: Swift.Int64, @@ -2648,7 +2651,8 @@ public enum Components { title: Swift.String, createdAt: Foundation.Date, verified: Swift.Bool, - readOnly: Swift.Bool + readOnly: Swift.Bool, + lastUsed: Foundation.Date? = nil ) { self.key = key self.id = id @@ -2657,6 +2661,7 @@ public enum Components { self.createdAt = createdAt self.verified = verified self.readOnly = readOnly + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case key @@ -2666,6 +2671,7 @@ public enum Components { case createdAt = "created_at" case verified case readOnly = "read_only" + case lastUsed = "last_used" } } /// Social media account @@ -2782,25 +2788,31 @@ public enum Components { public var key: Swift.String /// - Remark: Generated from `#/components/schemas/key-simple/created_at`. public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/key-simple/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `KeySimple`. /// /// - Parameters: /// - id: /// - key: /// - createdAt: + /// - lastUsed: public init( id: Swift.Int, key: Swift.String, - createdAt: Foundation.Date? = nil + createdAt: Foundation.Date? = nil, + lastUsed: Foundation.Date? = nil ) { self.id = id self.key = key self.createdAt = createdAt + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case id case key case createdAt = "created_at" + case lastUsed = "last_used" } } } diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index b15fded1fc..2c7afd9c19 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit b15fded1fc5fc6dcd68dd0425385625ee2e819a4 +Subproject commit 2c7afd9c1987eeb90da554f9bf12df48ca88ba33