Skip to content
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

Changes in generated code #135

Merged
merged 4 commits into from
Nov 5, 2024
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
6 changes: 2 additions & 4 deletions src/GitHub/App/Hook/Deliveries/DeliveriesRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public partial class DeliveriesRequestBuilder : BaseRequestBuilder
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public DeliveriesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*,redelivery*}", pathParameters)
public DeliveriesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*}", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="global::GitHub.App.Hook.Deliveries.DeliveriesRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public DeliveriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*,redelivery*}", rawUrl)
public DeliveriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*}", rawUrl)
{
}
/// <summary>
Expand Down Expand Up @@ -120,8 +120,6 @@ public partial class DeliveriesRequestBuilderGetQueryParameters
/// <summary>The number of results per page (max 100). For more information, see &quot;[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).&quot;</summary>
[QueryParameter("per_page")]
public int? PerPage { get; set; }
[QueryParameter("redelivery")]
public bool? Redelivery { get; set; }
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/GitHub/Enterprises/Item/Copilot/CopilotRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated/>
#pragma warning disable CS0618
using GitHub.Enterprises.Item.Copilot.Billing;
using GitHub.Enterprises.Item.Copilot.Metrics;
using GitHub.Enterprises.Item.Copilot.Usage;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
Expand All @@ -21,6 +22,11 @@ public partial class CopilotRequestBuilder : BaseRequestBuilder
{
get => new global::GitHub.Enterprises.Item.Copilot.Billing.BillingRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>The metrics property</summary>
public global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder Metrics
{
get => new global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>The usage property</summary>
public global::GitHub.Enterprises.Item.Copilot.Usage.UsageRequestBuilder Usage
{
Expand Down
130 changes: 130 additions & 0 deletions src/GitHub/Enterprises/Item/Copilot/Metrics/MetricsRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// <auto-generated/>
#pragma warning disable CS0618
using GitHub.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.Enterprises.Item.Copilot.Metrics
{
/// <summary>
/// Builds and executes requests for operations under \enterprises\{enterprise}\copilot\metrics
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public partial class MetricsRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public MetricsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?page*,per_page*,since*,until*}", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?page*,per_page*,since*,until*}", rawUrl)
{
}
/// <summary>
/// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to &quot;no policy&quot; for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
/// API method documentation <see href="https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise" />
/// </summary>
/// <returns>A List&lt;global::GitHub.Models.CopilotUsageMetricsDay&gt;</returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::GitHub.Models.BasicError">When receiving a 403 status code</exception>
/// <exception cref="global::GitHub.Models.BasicError">When receiving a 404 status code</exception>
/// <exception cref="global::GitHub.Models.BasicError">When receiving a 422 status code</exception>
/// <exception cref="global::GitHub.Models.BasicError">When receiving a 500 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<List<global::GitHub.Models.CopilotUsageMetricsDay>?> GetAsync(Action<RequestConfiguration<global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder.MetricsRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<List<global::GitHub.Models.CopilotUsageMetricsDay>> GetAsync(Action<RequestConfiguration<global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder.MetricsRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{ "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue },
{ "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue },
{ "422", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue },
{ "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue },
};
var collectionResult = await RequestAdapter.SendCollectionAsync<global::GitHub.Models.CopilotUsageMetricsDay>(requestInfo, global::GitHub.Models.CopilotUsageMetricsDay.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <summary>
/// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to &quot;no policy&quot; for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder.MetricsRequestBuilderGetQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder.MetricsRequestBuilderGetQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
return requestInfo;
}
/// <summary>
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
/// </summary>
/// <returns>A <see cref="global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder"/></returns>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder WithUrl(string rawUrl)
{
return new global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to &quot;no policy&quot; for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public partial class MetricsRequestBuilderGetQueryParameters
{
/// <summary>The page number of the results to fetch. For more information, see &quot;[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).&quot;</summary>
[QueryParameter("page")]
public int? Page { get; set; }
/// <summary>The number of days of metrics to display per page (max 28). For more information, see &quot;[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).&quot;</summary>
[QueryParameter("per_page")]
public int? PerPage { get; set; }
/// <summary>Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("since")]
public string? Since { get; set; }
#nullable restore
#else
[QueryParameter("since")]
public string Since { get; set; }
#endif
/// <summary>Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("until")]
public string? Until { get; set; }
#nullable restore
#else
[QueryParameter("until")]
public string Until { get; set; }
#endif
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// <auto-generated/>
#pragma warning disable CS0618
using GitHub.Enterprises.Item.Team.Item.Copilot.Metrics;
using GitHub.Enterprises.Item.Team.Item.Copilot.Usage;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
Expand All @@ -15,6 +16,11 @@ namespace GitHub.Enterprises.Item.Team.Item.Copilot
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public partial class CopilotRequestBuilder : BaseRequestBuilder
{
/// <summary>The metrics property</summary>
public global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder Metrics
{
get => new global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>The usage property</summary>
public global::GitHub.Enterprises.Item.Team.Item.Copilot.Usage.UsageRequestBuilder Usage
{
Expand Down
Loading
Loading