Skip to content

Bump Submodule/github/rest-api-description from 1e07c60 to 3a05345 #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ builder:
- GitHubRestAPIDependency_Graph
- GitHubRestAPIDesktop
- GitHubRestAPIEmojis
- GitHubRestAPIEnterprise_Teams
- GitHubRestAPIGists
- GitHubRestAPIGit
- GitHubRestAPIGitignore
Expand Down
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ let package = Package(
.library(name: "GitHubRestAPIDependency_Graph", targets: ["GitHubRestAPIDependency_Graph"]),
.library(name: "GitHubRestAPIDesktop", targets: ["GitHubRestAPIDesktop"]),
.library(name: "GitHubRestAPIEmojis", targets: ["GitHubRestAPIEmojis"]),
.library(name: "GitHubRestAPIEnterprise_Teams", targets: ["GitHubRestAPIEnterprise_Teams"]),
.library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]),
.library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]),
.library(name: "GitHubRestAPIGitignore", targets: ["GitHubRestAPIGitignore"]),
Expand Down Expand Up @@ -166,6 +167,14 @@ let package = Package(
],
path: "Sources/emojis"
),
.target(
name: "GitHubRestAPIEnterprise_Teams",
dependencies: [
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
path: "Sources/enterprise-teams"
),
.target(
name: "GitHubRestAPIGists",
dependencies: [
Expand Down
373 changes: 373 additions & 0 deletions Sources/code-scanning/Client.swift

Large diffs are not rendered by default.

1,224 changes: 1,224 additions & 0 deletions Sources/code-scanning/Types.swift

Large diffs are not rendered by default.

196 changes: 0 additions & 196 deletions Sources/copilot/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1623,200 +1623,4 @@ public struct Client: APIProtocol {
}
)
}
/// Get a summary of Copilot usage for a team
///
/// **Note**: This endpoint is in beta and is subject to change.
///
/// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
/// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
/// See the response schema tab for detailed metrics definitions.
///
/// The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
/// they must have telemetry enabled in their IDE.
///
/// **Note**: This endpoint will only return results for a given day if the team had five or more members on that day.
///
/// Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,
/// and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.
///
/// 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.
///
/// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/usage`.
/// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`.
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 {
try await client.send(
input: input,
forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/orgs/{}/team/{}/copilot/usage",
parameters: [
input.path.org,
input.path.team_slug
]
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .get
)
suppressMutabilityWarning(&request)
try converter.setQueryItemAsURI(
in: &request,
style: .form,
explode: true,
name: "since",
value: input.query.since
)
try converter.setQueryItemAsURI(
in: &request,
style: .form,
explode: true,
name: "until",
value: input.query.until
)
try converter.setQueryItemAsURI(
in: &request,
style: .form,
explode: true,
name: "page",
value: input.query.page
)
try converter.setQueryItemAsURI(
in: &request,
style: .form,
explode: true,
name: "per_page",
value: input.query.per_page
)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
return (request, nil)
},
deserializer: { response, responseBody in
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
[Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .ok(.init(body: body))
case 500:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.internal_error.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .internalServerError(.init(body: body))
case 401:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.requires_authentication.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unauthorized(.init(body: body))
case 403:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.forbidden.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .forbidden(.init(body: body))
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.not_found.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .notFound(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
)
}
}
)
}
}
Loading