-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
5,481 additions
and
5,602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
src/libs/GitHub/Generated/GitHub.CopilotClient.CopilotUsageMetricsForEnterpriseTeam.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
|
||
#nullable enable | ||
|
||
namespace GitHub | ||
{ | ||
public partial class CopilotClient | ||
{ | ||
partial void PrepareCopilotUsageMetricsForEnterpriseTeamArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string enterprise, | ||
ref string teamSlug, | ||
ref string since, | ||
ref string until, | ||
ref int page, | ||
ref int perPage); | ||
partial void PrepareCopilotUsageMetricsForEnterpriseTeamRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string enterprise, | ||
string teamSlug, | ||
string since, | ||
string until, | ||
int page, | ||
int perPage); | ||
partial void ProcessCopilotUsageMetricsForEnterpriseTeamResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessCopilotUsageMetricsForEnterpriseTeamResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Get a summary of Copilot usage for an enterprise team<br/> | ||
/// > [!NOTE]<br/> | ||
/// > This endpoint is in beta and is subject to change.<br/> | ||
/// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE<br/> | ||
/// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.<br/> | ||
/// See the response schema tab for detailed metrics definitions.<br/> | ||
/// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,<br/> | ||
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,<br/> | ||
/// they must have telemetry enabled in their IDE.<br/> | ||
/// > [!NOTE]<br/> | ||
/// > This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.<br/> | ||
/// Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.<br/> | ||
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. | ||
/// </summary> | ||
/// <param name="enterprise"></param> | ||
/// <param name="teamSlug"></param> | ||
/// <param name="since"></param> | ||
/// <param name="until"></param> | ||
/// <param name="page"> | ||
/// Default Value: 1 | ||
/// </param> | ||
/// <param name="perPage"> | ||
/// Default Value: 28 | ||
/// </param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::System.Collections.Generic.IList<global::GitHub.CopilotUsageMetrics>> CopilotUsageMetricsForEnterpriseTeamAsync( | ||
string enterprise, | ||
string teamSlug, | ||
string since, | ||
string until, | ||
int page, | ||
int perPage, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareCopilotUsageMetricsForEnterpriseTeamArguments( | ||
httpClient: _httpClient, | ||
enterprise: ref enterprise, | ||
teamSlug: ref teamSlug, | ||
since: ref since, | ||
until: ref until, | ||
page: ref page, | ||
perPage: ref perPage); | ||
|
||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Get, | ||
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/enterprises/{enterprise}/team/{teamSlug}/copilot/usage?since={since}&until={until}&page={page}&per_page={perPage}", global::System.UriKind.RelativeOrAbsolute)); | ||
|
||
PrepareRequest( | ||
client: _httpClient, | ||
request: httpRequest); | ||
PrepareCopilotUsageMetricsForEnterpriseTeamRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
enterprise: enterprise, | ||
teamSlug: teamSlug, | ||
since: since, | ||
until: until, | ||
page: page, | ||
perPage: perPage); | ||
|
||
using var response = await _httpClient.SendAsync( | ||
request: httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: _httpClient, | ||
response: response); | ||
ProcessCopilotUsageMetricsForEnterpriseTeamResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessCopilotUsageMetricsForEnterpriseTeamResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::GitHub.SourceGenerationContext.Default.IListCopilotUsageMetrics) ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
220 changes: 0 additions & 220 deletions
220
src/libs/GitHub/Generated/GitHub.Models.Organization.g.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.