Skip to content

Commit 2bc00ab

Browse files
Merge pull request #53 from Wei18/dependabot/submodules/Submodule/github/rest-api-description-3a05345
Bump Submodule/github/rest-api-description from `1e07c60` to `3a05345`
2 parents fbf3b8a + 94b0ee4 commit 2bc00ab

File tree

10 files changed

+1699
-544
lines changed

10 files changed

+1699
-544
lines changed

.spi.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ builder:
1616
- GitHubRestAPIDependency_Graph
1717
- GitHubRestAPIDesktop
1818
- GitHubRestAPIEmojis
19+
- GitHubRestAPIEnterprise_Teams
1920
- GitHubRestAPIGists
2021
- GitHubRestAPIGit
2122
- GitHubRestAPIGitignore

Package.swift

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let package = Package(
2525
.library(name: "GitHubRestAPIDependency_Graph", targets: ["GitHubRestAPIDependency_Graph"]),
2626
.library(name: "GitHubRestAPIDesktop", targets: ["GitHubRestAPIDesktop"]),
2727
.library(name: "GitHubRestAPIEmojis", targets: ["GitHubRestAPIEmojis"]),
28+
.library(name: "GitHubRestAPIEnterprise_Teams", targets: ["GitHubRestAPIEnterprise_Teams"]),
2829
.library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]),
2930
.library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]),
3031
.library(name: "GitHubRestAPIGitignore", targets: ["GitHubRestAPIGitignore"]),
@@ -166,6 +167,14 @@ let package = Package(
166167
],
167168
path: "Sources/emojis"
168169
),
170+
.target(
171+
name: "GitHubRestAPIEnterprise_Teams",
172+
dependencies: [
173+
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
174+
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
175+
],
176+
path: "Sources/enterprise-teams"
177+
),
169178
.target(
170179
name: "GitHubRestAPIGists",
171180
dependencies: [

Sources/code-scanning/Client.swift

+373
Large diffs are not rendered by default.

Sources/code-scanning/Types.swift

+1,224
Large diffs are not rendered by default.

Sources/copilot/Client.swift

-196
Original file line numberDiff line numberDiff line change
@@ -1623,200 +1623,4 @@ public struct Client: APIProtocol {
16231623
}
16241624
)
16251625
}
1626-
/// Get a summary of Copilot usage for a team
1627-
///
1628-
/// **Note**: This endpoint is in beta and is subject to change.
1629-
///
1630-
/// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
1631-
/// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
1632-
/// See the response schema tab for detailed metrics definitions.
1633-
///
1634-
/// The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,
1635-
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
1636-
/// they must have telemetry enabled in their IDE.
1637-
///
1638-
/// **Note**: This endpoint will only return results for a given day if the team had five or more members on that day.
1639-
///
1640-
/// Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,
1641-
/// and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.
1642-
///
1643-
/// OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint.
1644-
///
1645-
/// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`.
1646-
/// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`.
1647-
public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output {
1648-
try await client.send(
1649-
input: input,
1650-
forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.id,
1651-
serializer: { input in
1652-
let path = try converter.renderedPath(
1653-
template: "/orgs/{}/team/{}/copilot/usage",
1654-
parameters: [
1655-
input.path.org,
1656-
input.path.team_slug
1657-
]
1658-
)
1659-
var request: HTTPTypes.HTTPRequest = .init(
1660-
soar_path: path,
1661-
method: .get
1662-
)
1663-
suppressMutabilityWarning(&request)
1664-
try converter.setQueryItemAsURI(
1665-
in: &request,
1666-
style: .form,
1667-
explode: true,
1668-
name: "since",
1669-
value: input.query.since
1670-
)
1671-
try converter.setQueryItemAsURI(
1672-
in: &request,
1673-
style: .form,
1674-
explode: true,
1675-
name: "until",
1676-
value: input.query.until
1677-
)
1678-
try converter.setQueryItemAsURI(
1679-
in: &request,
1680-
style: .form,
1681-
explode: true,
1682-
name: "page",
1683-
value: input.query.page
1684-
)
1685-
try converter.setQueryItemAsURI(
1686-
in: &request,
1687-
style: .form,
1688-
explode: true,
1689-
name: "per_page",
1690-
value: input.query.per_page
1691-
)
1692-
converter.setAcceptHeader(
1693-
in: &request.headerFields,
1694-
contentTypes: input.headers.accept
1695-
)
1696-
return (request, nil)
1697-
},
1698-
deserializer: { response, responseBody in
1699-
switch response.status.code {
1700-
case 200:
1701-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1702-
let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body
1703-
let chosenContentType = try converter.bestContentType(
1704-
received: contentType,
1705-
options: [
1706-
"application/json"
1707-
]
1708-
)
1709-
switch chosenContentType {
1710-
case "application/json":
1711-
body = try await converter.getResponseBodyAsJSON(
1712-
[Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self,
1713-
from: responseBody,
1714-
transforming: { value in
1715-
.json(value)
1716-
}
1717-
)
1718-
default:
1719-
preconditionFailure("bestContentType chose an invalid content type.")
1720-
}
1721-
return .ok(.init(body: body))
1722-
case 500:
1723-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1724-
let body: Components.Responses.internal_error.Body
1725-
let chosenContentType = try converter.bestContentType(
1726-
received: contentType,
1727-
options: [
1728-
"application/json"
1729-
]
1730-
)
1731-
switch chosenContentType {
1732-
case "application/json":
1733-
body = try await converter.getResponseBodyAsJSON(
1734-
Components.Schemas.basic_hyphen_error.self,
1735-
from: responseBody,
1736-
transforming: { value in
1737-
.json(value)
1738-
}
1739-
)
1740-
default:
1741-
preconditionFailure("bestContentType chose an invalid content type.")
1742-
}
1743-
return .internalServerError(.init(body: body))
1744-
case 401:
1745-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1746-
let body: Components.Responses.requires_authentication.Body
1747-
let chosenContentType = try converter.bestContentType(
1748-
received: contentType,
1749-
options: [
1750-
"application/json"
1751-
]
1752-
)
1753-
switch chosenContentType {
1754-
case "application/json":
1755-
body = try await converter.getResponseBodyAsJSON(
1756-
Components.Schemas.basic_hyphen_error.self,
1757-
from: responseBody,
1758-
transforming: { value in
1759-
.json(value)
1760-
}
1761-
)
1762-
default:
1763-
preconditionFailure("bestContentType chose an invalid content type.")
1764-
}
1765-
return .unauthorized(.init(body: body))
1766-
case 403:
1767-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1768-
let body: Components.Responses.forbidden.Body
1769-
let chosenContentType = try converter.bestContentType(
1770-
received: contentType,
1771-
options: [
1772-
"application/json"
1773-
]
1774-
)
1775-
switch chosenContentType {
1776-
case "application/json":
1777-
body = try await converter.getResponseBodyAsJSON(
1778-
Components.Schemas.basic_hyphen_error.self,
1779-
from: responseBody,
1780-
transforming: { value in
1781-
.json(value)
1782-
}
1783-
)
1784-
default:
1785-
preconditionFailure("bestContentType chose an invalid content type.")
1786-
}
1787-
return .forbidden(.init(body: body))
1788-
case 404:
1789-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1790-
let body: Components.Responses.not_found.Body
1791-
let chosenContentType = try converter.bestContentType(
1792-
received: contentType,
1793-
options: [
1794-
"application/json"
1795-
]
1796-
)
1797-
switch chosenContentType {
1798-
case "application/json":
1799-
body = try await converter.getResponseBodyAsJSON(
1800-
Components.Schemas.basic_hyphen_error.self,
1801-
from: responseBody,
1802-
transforming: { value in
1803-
.json(value)
1804-
}
1805-
)
1806-
default:
1807-
preconditionFailure("bestContentType chose an invalid content type.")
1808-
}
1809-
return .notFound(.init(body: body))
1810-
default:
1811-
return .undocumented(
1812-
statusCode: response.status.code,
1813-
.init(
1814-
headerFields: response.headerFields,
1815-
body: responseBody
1816-
)
1817-
)
1818-
}
1819-
}
1820-
)
1821-
}
18221626
}

0 commit comments

Comments
 (0)