From 7607cc77baad4615ec03773312106b9ea231afd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 22:02:08 +0000 Subject: [PATCH 1/2] Bump Submodule/github/rest-api-description from `11e7786` to `60482fa` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `11e7786` to `60482fa`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/11e778654010c505cc7dd3d65885a3bea042ca6c...60482fa6aa943ad299eb3d1f5e91c3b38f79972b) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 11e7786540..60482fa6aa 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 11e778654010c505cc7dd3d65885a3bea042ca6c +Subproject commit 60482fa6aa943ad299eb3d1f5e91c3b38f79972b From 527df7f71e92dce0ae93d92364f38de39cf417f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 1 Feb 2024 22:20:51 +0000 Subject: [PATCH 2/2] Commit via running ake Sources/repos --- Sources/repos/Client.swift | 11 +-- Sources/repos/Types.swift | 146 ++++++++++++++++++++++++++++++------- 2 files changed, 122 insertions(+), 35 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index be3d99597b..fcc281a8d7 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -1662,9 +1662,9 @@ public struct Client: APIProtocol { } ) } - /// List all autolinks of a repository + /// Get all autolinks of a repository /// - /// This returns a list of autolinks configured for the given repository. + /// Gets all autolinks that are configured for a repository. /// /// Information about autolinks are only available to repository administrators. /// @@ -1687,13 +1687,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 1c01999425..a0db5fce81 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -121,9 +121,9 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/activity`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/activity/get(repos/list-activities)`. func repos_sol_list_hyphen_activities(_ input: Operations.repos_sol_list_hyphen_activities.Input) async throws -> Operations.repos_sol_list_hyphen_activities.Output - /// List all autolinks of a repository + /// Get all autolinks of a repository /// - /// This returns a list of autolinks configured for the given repository. + /// Gets all autolinks that are configured for a repository. /// /// Information about autolinks are only available to repository administrators. /// @@ -2214,9 +2214,9 @@ extension APIProtocol { headers: headers )) } - /// List all autolinks of a repository + /// Get all autolinks of a repository /// - /// This returns a list of autolinks configured for the given repository. + /// Gets all autolinks that are configured for a repository. /// /// Information about autolinks are only available to repository administrators. /// @@ -2224,12 +2224,10 @@ extension APIProtocol { /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/autolinks/get(repos/list-autolinks)`. public func repos_sol_list_hyphen_autolinks( path: Operations.repos_sol_list_hyphen_autolinks.Input.Path, - query: Operations.repos_sol_list_hyphen_autolinks.Input.Query = .init(), headers: Operations.repos_sol_list_hyphen_autolinks.Input.Headers = .init() ) async throws -> Operations.repos_sol_list_hyphen_autolinks.Output { try await repos_sol_list_hyphen_autolinks(Operations.repos_sol_list_hyphen_autolinks.Input( path: path, - query: query, headers: headers )) } @@ -12440,6 +12438,79 @@ public enum Components { case repository_id } } + /// Parameters for a targeting a repository property + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec`. + public struct repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec: Codable, Hashable, Sendable { + /// The name of the repository property to target + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/name`. + public var name: Swift.String + /// The values to match for the repository property + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-spec/property_values`. + public var property_values: [Swift.String] + /// Creates a new `repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec`. + /// + /// - Parameters: + /// - name: The name of the repository property to target + /// - property_values: The values to match for the repository property + public init( + name: Swift.String, + property_values: [Swift.String] + ) { + self.name = name + self.property_values = property_values + } + public enum CodingKeys: String, CodingKey { + case name + case property_values + } + } + /// Parameters for a repository property condition + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target`. + public struct repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. + public struct repository_propertyPayload: Codable, Hashable, Sendable { + /// The repository properties and values to include. All of these properties must match for the condition to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/include`. + public var include: [Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec]? + /// The repository properties and values to exclude. The condition will not pass if any of these properties match. + /// + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property/exclude`. + public var exclude: [Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec]? + /// Creates a new `repository_propertyPayload`. + /// + /// - Parameters: + /// - include: The repository properties and values to include. All of these properties must match for the condition to pass. + /// - exclude: The repository properties and values to exclude. The condition will not pass if any of these properties match. + public init( + include: [Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec]? = nil, + exclude: [Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_spec]? = nil + ) { + self.include = include + self.exclude = exclude + } + public enum CodingKeys: String, CodingKey { + case include + case exclude + } + } + /// - Remark: Generated from `#/components/schemas/repository-ruleset-conditions-repository-property-target/repository_property`. + public var repository_property: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target.repository_propertyPayload + /// Creates a new `repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target`. + /// + /// - Parameters: + /// - repository_property: + public init(repository_property: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target.repository_propertyPayload) { + self.repository_property = repository_property + } + public enum CodingKeys: String, CodingKey { + case repository_property + } + } /// Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. /// /// @@ -12511,6 +12582,39 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case2`. case case2(Components.Schemas.org_hyphen_ruleset_hyphen_conditions.Case2Payload) + /// Conditions to target repositories by property and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value1`. + public var value1: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3/value2`. + public var value2: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions, + value2: Components.Schemas.repository_hyphen_ruleset_hyphen_conditions_hyphen_repository_hyphen_property_hyphen_target + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// Conditions to target repositories by property and refs by name + /// + /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions/case3`. + case case3(Components.Schemas.org_hyphen_ruleset_hyphen_conditions.Case3Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -12525,6 +12629,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -12537,6 +12647,8 @@ public enum Components { try value.encode(to: encoder) case let .case2(value): try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) } } } @@ -26666,9 +26778,9 @@ public enum Operations { } } } - /// List all autolinks of a repository + /// Get all autolinks of a repository /// - /// This returns a list of autolinks configured for the given repository. + /// Gets all autolinks that are configured for a repository. /// /// Information about autolinks are only available to repository administrators. /// @@ -26701,21 +26813,6 @@ public enum Operations { } } public var path: Operations.repos_sol_list_hyphen_autolinks.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/autolinks/GET/query`. - public struct Query: Sendable, Hashable { - /// 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/autolinks/GET/query/page`. - public var page: Components.Parameters.page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - 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)." - public init(page: Components.Parameters.page? = nil) { - self.page = page - } - } - public var query: Operations.repos_sol_list_hyphen_autolinks.Input.Query /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/autolinks/GET/header`. public struct Headers: Sendable, Hashable { public var accept: [OpenAPIRuntime.AcceptHeaderContentType] @@ -26732,15 +26829,12 @@ public enum Operations { /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( path: Operations.repos_sol_list_hyphen_autolinks.Input.Path, - query: Operations.repos_sol_list_hyphen_autolinks.Input.Query = .init(), headers: Operations.repos_sol_list_hyphen_autolinks.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } }