From 232d82c5efef156238b1c81fe30778fd4fc6362e Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Wed, 7 Aug 2024 00:26:58 +0000 Subject: [PATCH 1/2] New updates to generated code --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 31c5268a..3c4df38d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ +> [!IMPORTANT] +> This SDK is not yet stable. Breaking changes may occur at any time. + # Octokit: .NET SDK -[![Build and test .NET SDK](https://github.com/octokit/dotnet-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/octokit/dotnet-sdk/actions/workflows/build.yml) [![CodeQL](https://github.com/octokit/dotnet-sdk/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/octokit/dotnet-sdk/actions/workflows/github-code-scanning/codeql) [![Publish Release to NuGet](https://github.com/octokit/dotnet-sdk/actions/workflows/publish.yml/badge.svg)](https://github.com/octokit/dotnet-sdk/actions/workflows/publish.yml) +[![Build and test .NET SDK](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/build.yml/badge.svg)](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/build.yml) [![CodeQL](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/github-code-scanning/codeql) [![Publish Release to NuGet](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/publish.yml/badge.svg)](https://github.com/octokit/dotnet-sdk-enterprise-cloud/actions/workflows/publish.yml) An "alpha" version of a generated .NET SDK in C# for GitHub's Enterprise Cloud product, generated from [GitHub's OpenAPI spec](https://github.com/github/rest-api-description), built on [Kiota](https://github.com/microsoft/kiota). View on [NuGet](https://www.nuget.org/packages/GitHub.Octokit.SDK/). @@ -12,11 +15,13 @@ You may also want: - [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.SDK) - For GitHub Enterprise Cloud - [dotnet-sdk-enterprise-cloud repository](https://github.com/octokit/dotnet-sdk-enterprise-cloud) + - [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.GHEC.SDK/) - For GitHub Enterprise Server - [dotnet-sdk-enterprise-server repository](https://github.com/octokit/dotnet-sdk-enterprise-server) + - [NuGet link](https://www.nuget.org/packages?q=GitHub.Octokit.GHES.SDK) - For our classic non-generated, hand-maintained Octokit.net project - [Octokit.net repository](https://github.com/octokit/octokit.net) - - For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below + - [NuGet link](https://www.nuget.org/packages/Octokit/) - Go - For the standard GitHub.com product - [go-sdk repository](https://github.com/octokit/go-sdk) @@ -29,6 +34,7 @@ You may also want: - [pkg.go.dev docs link](https://pkg.go.dev/github.com/octokit/go-sdk-enterprise-server) - [source-generator](https://github.com/octokit/source-generator) (the repository that creates these generated SDKs) - Contributions to this repository should take place in source-generator instead, as they'll be distributed here through mechanisms there. +- For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below ## How do I use it? @@ -59,9 +65,6 @@ foreach (var pullRequest in pullRequests) } ``` -> [!IMPORTANT] -> This SDK is not yet stable. Breaking changes may occur at any time. - ### Authentication This SDK supports [Personal Access Tokens (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic), [fine-grained Personal Access Tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens), and [GitHub Apps](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) authentication. @@ -127,7 +130,7 @@ Currently this project is fairly simple (we hope it can stay that way). All of - Generate test report: `dotnet reportgenerator -targetdir:$(pwd)/test/coverage/Report/ -reports:$(pwd)/test/coverage/coverage.opencover.xml` - Note that this requires installing [ReportGenerator](https://github.com/danielpalme/ReportGenerator), whose installation instructions can be found [here](https://github.com/danielpalme/ReportGenerator?tab=readme-ov-file#install-the-package-matching-your-platform-and-needs) - We're using the `dotnet-reportgenerator-globaltool`, so follow that set of installation instructions -- The test report can be viewed by opening the generated report file (logged to CLI output, something like `/path/to/your/repo/dotnet-sdk/test/coverage/Report/index.html`) in a browser +- The test report can be viewed by opening the generated report file (logged to CLI output, something like `/path/to/your/repo/dotnet-sdk-enterprise-cloud/test/coverage/Report/index.html`) in a browser ## More details on this SDK and repo From f9cd2cd8b10a72c6259b3e71a424f6d29b983f1d Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 15 Aug 2024 00:26:36 +0000 Subject: [PATCH 2/2] New updates to generated code --- README.md | 4 +- .../Item/Copilot/Usage/UsageRequestBuilder.cs | 6 +- .../Item/Resource/ResourceRequestBuilder.cs | 2 + .../Item/Copilot/CopilotRequestBuilder.cs | 37 +++ .../Item/Copilot/Usage/UsageRequestBuilder.cs | 125 ++++++++ .../Item/WithTeam_slugItemRequestBuilder.cs | 37 +++ .../Item/Team/TeamRequestBuilder.cs | 44 +++ .../Item/WithEnterpriseItemRequestBuilder.cs | 6 + src/GitHub/Models/ApiOverview.cs | 10 + .../Models/CodeSecurityConfiguration.cs | 14 + ...tion_dependency_graph_autosubmit_action.cs | 21 ++ ...endency_graph_autosubmit_action_options.cs | 56 ++++ src/GitHub/Models/CopilotSeatDetails.cs | 94 ------ .../Models/CopilotSeatDetails_assignee.cs | 52 ++++ ...OrgCustomProperty.cs => CustomProperty.cs} | 50 ++-- ...e_type.cs => CustomProperty_value_type.cs} | 2 +- ...s => CustomProperty_values_editable_by.cs} | 2 +- src/GitHub/Models/Organization.cs | 282 ------------------ ...RepositoryRulesetBypassActor_actor_type.cs | 4 + ... => SecretScanningPushProtectionBypass.cs} | 46 ++- ...retScanningPushProtectionBypass503Error.cs | 82 +++++ ...ecretScanningPushProtectionBypassReason.cs | 21 ++ src/GitHub/Models/Users.cs | 54 +++- src/GitHub/Models/Users_matches.cs | 71 +++++ .../ConfigurationsPostRequestBody.cs | 15 + ...Body_dependency_graph_autosubmit_action.cs | 21 ++ ...endency_graph_autosubmit_action_options.cs | 56 ++++ .../WithConfiguration_PatchRequestBody.cs | 14 + ...Body_dependency_graph_autosubmit_action.cs | 21 ++ ...endency_graph_autosubmit_action_options.cs | 56 ++++ .../Item/Copilot/Usage/UsageRequestBuilder.cs | 6 +- .../Item/Teams/TeamsRequestBuilder.cs | 2 +- ...hCustom_property_nameItemRequestBuilder.cs | 16 +- .../Schema/SchemaPatchRequestBody.cs | 8 +- .../Properties/Schema/SchemaRequestBuilder.cs | 16 +- .../Orgs/Item/Repos/ReposPostRequestBody.cs | 4 +- ...ReposPostRequestBody_merge_commit_title.cs | 2 +- ...stRequestBody_squash_merge_commit_title.cs | 2 +- .../Item/WithRuleset_ItemRequestBuilder.cs | 4 +- .../Item/Copilot/CopilotRequestBuilder.cs | 37 +++ .../Item/Copilot/Usage/UsageRequestBuilder.cs | 125 ++++++++ .../Item/WithTeam_slugItemRequestBuilder.cs | 37 +++ .../Orgs/Item/Team/TeamRequestBuilder.cs | 44 +++ .../Teams/Item/Teams/TeamsRequestBuilder.cs | 2 +- .../Orgs/Item/Teams/TeamsRequestBuilder.cs | 2 +- .../Orgs/Item/WithOrgItemRequestBuilder.cs | 6 + .../Restrictions/Teams/TeamsRequestBuilder.cs | 32 +- .../Repos/Item/Item/RepoPatchRequestBody.cs | 4 +- ...RepoPatchRequestBody_merge_commit_title.cs | 2 +- ...chRequestBody_squash_merge_commit_title.cs | 2 +- .../Item/WithRuleset_ItemRequestBuilder.cs | 6 +- .../PushProtectionBypassesPostRequestBody.cs | 66 ++++ .../PushProtectionBypassesRequestBuilder.cs | 91 ++++++ .../SecretScanningRequestBuilder.cs | 6 + .../Item/Item/Teams/TeamsRequestBuilder.cs | 8 +- .../Teams/Item/Teams/TeamsRequestBuilder.cs | 8 +- src/GitHub/User/Repos/ReposPostRequestBody.cs | 4 +- ...ReposPostRequestBody_merge_commit_title.cs | 2 +- ...stRequestBody_squash_merge_commit_title.cs | 2 +- src/GitHub/kiota-lock.json | 2 +- 60 files changed, 1340 insertions(+), 513 deletions(-) create mode 100644 src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs create mode 100644 src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action.cs create mode 100644 src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action_options.cs create mode 100644 src/GitHub/Models/CopilotSeatDetails_assignee.cs rename src/GitHub/Models/{OrgCustomProperty.cs => CustomProperty.cs} (75%) rename src/GitHub/Models/{OrgCustomProperty_value_type.cs => CustomProperty_value_type.cs} (94%) rename src/GitHub/Models/{OrgCustomProperty_values_editable_by.cs => CustomProperty_values_editable_by.cs} (90%) delete mode 100644 src/GitHub/Models/Organization.cs rename src/GitHub/Models/{Organization_plan.cs => SecretScanningPushProtectionBypass.cs} (55%) create mode 100644 src/GitHub/Models/SecretScanningPushProtectionBypass503Error.cs create mode 100644 src/GitHub/Models/SecretScanningPushProtectionBypassReason.cs create mode 100644 src/GitHub/Models/Users_matches.cs create mode 100644 src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs create mode 100644 src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs create mode 100644 src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs create mode 100644 src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs create mode 100644 src/GitHub/Orgs/Item/Team/Item/Copilot/CopilotRequestBuilder.cs create mode 100644 src/GitHub/Orgs/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs create mode 100644 src/GitHub/Orgs/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs create mode 100644 src/GitHub/Orgs/Item/Team/TeamRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesPostRequestBody.cs create mode 100644 src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesRequestBuilder.cs diff --git a/README.md b/README.md index 3c4df38d..5b560736 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,7 @@ Note that the SDK **does not yet** support authenticating as the App itself and ## Why a generated SDK? -We want to... -1. provide 100% coverage of the API in our SDK -1. use this as a building block for future SDK tooling +Please take a moment and head over to the GitHub blog to read more about the [why's and how's behind our move to Generative SDKs](https://github.blog/news-insights/product-news/our-move-to-generated-sdks/). ## Why .NET? diff --git a/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs index e5c16728..4a4b59de 100644 --- a/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs @@ -31,7 +31,7 @@ public UsageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base { } /// - /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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.Only owners and billing managers can view Copilot usage 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. + /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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 up to 28 days prior. 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.Only owners and billing managers can view Copilot usage 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 /// /// A List<CopilotUsageMetrics> @@ -62,7 +62,7 @@ public async Task> GetAsync(Action - /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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.Only owners and billing managers can view Copilot usage 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. + /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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 up to 28 days prior. 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.Only owners and billing managers can view Copilot usage 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. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -90,7 +90,7 @@ public UsageRequestBuilder WithUrl(string rawUrl) return new UsageRequestBuilder(rawUrl, RequestAdapter); } /// - /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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.Only owners and billing managers can view Copilot usage 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. + /// > [!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 IDEfor all users across organizations with access to Copilot within your enterprise, 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 up to 28 days prior. 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.Only owners and billing managers can view Copilot usage 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. /// public class UsageRequestBuilderGetQueryParameters { diff --git a/src/GitHub/Enterprises/Item/Settings/Billing/CostCenters/Item/Resource/ResourceRequestBuilder.cs b/src/GitHub/Enterprises/Item/Settings/Billing/CostCenters/Item/Resource/ResourceRequestBuilder.cs index 065e7284..26756a90 100644 --- a/src/GitHub/Enterprises/Item/Settings/Billing/CostCenters/Item/Resource/ResourceRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/Settings/Billing/CostCenters/Item/Resource/ResourceRequestBuilder.cs @@ -72,6 +72,7 @@ public async Task DeleteAsync(ResourceDeleteRequestBody /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 400 status code /// When receiving a 403 status code + /// When receiving a 409 status code /// When receiving a 500 status code /// When receiving a 503 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -89,6 +90,7 @@ public async Task PostAsync(ResourcePostRequestBody body, { {"400", BasicError.CreateFromDiscriminatorValue}, {"403", BasicError.CreateFromDiscriminatorValue}, + {"409", BasicError.CreateFromDiscriminatorValue}, {"500", BasicError.CreateFromDiscriminatorValue}, {"503", Resource503Error.CreateFromDiscriminatorValue}, }; diff --git a/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs new file mode 100644 index 00000000..e0d9e97d --- /dev/null +++ b/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using GitHub.Enterprises.Item.Team.Item.Copilot.Usage; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Enterprises.Item.Team.Item.Copilot { + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot + /// + public class CopilotRequestBuilder : BaseRequestBuilder + { + /// The usage property + public UsageRequestBuilder Usage + { + get => new UsageRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CopilotRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CopilotRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot", rawUrl) + { + } + } +} diff --git a/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs new file mode 100644 index 00000000..90d219bd --- /dev/null +++ b/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.Team.Item.Copilot.Usage { + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot\usage + /// + public class UsageRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UsageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UsageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/usage{?page*,per_page*,since*,until*}", rawUrl) + { + } + /// + /// > [!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 IDEfor users within an enterprise 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 up to 28 days prior. 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.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 + /// + /// A List<CopilotUsageMetrics> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 500 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + {"401", BasicError.CreateFromDiscriminatorValue}, + {"403", BasicError.CreateFromDiscriminatorValue}, + {"404", BasicError.CreateFromDiscriminatorValue}, + {"500", BasicError.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CopilotUsageMetrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// > [!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 IDEfor users within an enterprise 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 up to 28 days prior. 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public UsageRequestBuilder WithUrl(string rawUrl) + { + return new UsageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// > [!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 IDEfor users within an enterprise 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 up to 28 days prior. 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + public class UsageRequestBuilderGetQueryParameters + { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-cloud@latest//rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("page")] + public int? Page { get; set; } + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-cloud@latest//rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// 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. +#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 + /// 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. +#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 + } + } +} diff --git a/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs new file mode 100644 index 00000000..2f3728a0 --- /dev/null +++ b/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using GitHub.Enterprises.Item.Team.Item.Copilot; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Enterprises.Item.Team.Item { + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug} + /// + public class WithTeam_slugItemRequestBuilder : BaseRequestBuilder + { + /// The copilot property + public CopilotRequestBuilder Copilot + { + get => new CopilotRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTeam_slugItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTeam_slugItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}", rawUrl) + { + } + } +} diff --git a/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs new file mode 100644 index 00000000..3b939a79 --- /dev/null +++ b/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using GitHub.Enterprises.Item.Team.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Enterprises.Item.Team { + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\team + /// + public class TeamRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the GitHub.enterprises.item.team.item collection + /// The slug of the team name. + /// A + public WithTeam_slugItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("team_slug", position); + return new WithTeam_slugItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeamRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team", rawUrl) + { + } + } +} diff --git a/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs b/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs index 075469a6..085cfd50 100644 --- a/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs @@ -11,6 +11,7 @@ using GitHub.Enterprises.Item.LicenseSyncStatus; using GitHub.Enterprises.Item.SecretScanning; using GitHub.Enterprises.Item.Settings; +using GitHub.Enterprises.Item.Team; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; using System.IO; @@ -78,6 +79,11 @@ public SettingsRequestBuilder Settings { get => new SettingsRequestBuilder(PathParameters, RequestAdapter); } + /// The team property + public TeamRequestBuilder Team + { + get => new TeamRequestBuilder(PathParameters, RequestAdapter); + } /// Gets an item from the GitHub.enterprises.item.item collection /// The security feature to enable or disable. /// A diff --git a/src/GitHub/Models/ApiOverview.cs b/src/GitHub/Models/ApiOverview.cs index e398f358..3ffccffb 100644 --- a/src/GitHub/Models/ApiOverview.cs +++ b/src/GitHub/Models/ApiOverview.cs @@ -35,6 +35,14 @@ public class ApiOverview : IAdditionalDataHolder, IParsable #nullable restore #else public List Api { get; set; } +#endif + /// The copilot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Copilot { get; set; } +#nullable restore +#else + public List Copilot { get; set; } #endif /// The dependabot property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -154,6 +162,7 @@ public virtual IDictionary> GetFieldDeserializers() {"actions", n => { Actions = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, {"actions_macos", n => { ActionsMacos = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, {"api", n => { Api = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"copilot", n => { Copilot = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, {"dependabot", n => { Dependabot = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, {"domains", n => { Domains = n.GetObjectValue(ApiOverview_domains.CreateFromDiscriminatorValue); } }, {"git", n => { Git = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, @@ -178,6 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfPrimitiveValues("actions", Actions); writer.WriteCollectionOfPrimitiveValues("actions_macos", ActionsMacos); writer.WriteCollectionOfPrimitiveValues("api", Api); + writer.WriteCollectionOfPrimitiveValues("copilot", Copilot); writer.WriteCollectionOfPrimitiveValues("dependabot", Dependabot); writer.WriteObjectValue("domains", Domains); writer.WriteCollectionOfPrimitiveValues("git", Git); diff --git a/src/GitHub/Models/CodeSecurityConfiguration.cs b/src/GitHub/Models/CodeSecurityConfiguration.cs index 83bdcf08..e8cbaac6 100644 --- a/src/GitHub/Models/CodeSecurityConfiguration.cs +++ b/src/GitHub/Models/CodeSecurityConfiguration.cs @@ -24,6 +24,16 @@ public class CodeSecurityConfiguration : IAdditionalDataHolder, IParsable public CodeSecurityConfiguration_dependabot_security_updates? DependabotSecurityUpdates { get; set; } /// The enablement status of Dependency Graph public CodeSecurityConfiguration_dependency_graph? DependencyGraph { get; set; } + /// The enablement status of Automatic dependency submission + public CodeSecurityConfiguration_dependency_graph_autosubmit_action? DependencyGraphAutosubmitAction { get; set; } + /// Feature options for Automatic dependency submission +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CodeSecurityConfiguration_dependency_graph_autosubmit_action_options? DependencyGraphAutosubmitActionOptions { get; set; } +#nullable restore +#else + public CodeSecurityConfiguration_dependency_graph_autosubmit_action_options DependencyGraphAutosubmitActionOptions { get; set; } +#endif /// A description of the code security configuration #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -103,6 +113,8 @@ public virtual IDictionary> GetFieldDeserializers() {"dependabot_alerts", n => { DependabotAlerts = n.GetEnumValue(); } }, {"dependabot_security_updates", n => { DependabotSecurityUpdates = n.GetEnumValue(); } }, {"dependency_graph", n => { DependencyGraph = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action", n => { DependencyGraphAutosubmitAction = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action_options", n => { DependencyGraphAutosubmitActionOptions = n.GetObjectValue(CodeSecurityConfiguration_dependency_graph_autosubmit_action_options.CreateFromDiscriminatorValue); } }, {"description", n => { Description = n.GetStringValue(); } }, {"enforcement", n => { Enforcement = n.GetEnumValue(); } }, {"html_url", n => { HtmlUrl = n.GetStringValue(); } }, @@ -130,6 +142,8 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteEnumValue("dependabot_alerts", DependabotAlerts); writer.WriteEnumValue("dependabot_security_updates", DependabotSecurityUpdates); writer.WriteEnumValue("dependency_graph", DependencyGraph); + writer.WriteEnumValue("dependency_graph_autosubmit_action", DependencyGraphAutosubmitAction); + writer.WriteObjectValue("dependency_graph_autosubmit_action_options", DependencyGraphAutosubmitActionOptions); writer.WriteStringValue("description", Description); writer.WriteEnumValue("enforcement", Enforcement); writer.WriteStringValue("html_url", HtmlUrl); diff --git a/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action.cs b/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action.cs new file mode 100644 index 00000000..b35dfedd --- /dev/null +++ b/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models { + /// The enablement status of Automatic dependency submission + public enum CodeSecurityConfiguration_dependency_graph_autosubmit_action + { + [EnumMember(Value = "enabled")] + #pragma warning disable CS1591 + Enabled, + #pragma warning restore CS1591 + [EnumMember(Value = "disabled")] + #pragma warning disable CS1591 + Disabled, + #pragma warning restore CS1591 + [EnumMember(Value = "not_set")] + #pragma warning disable CS1591 + Not_set, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action_options.cs b/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action_options.cs new file mode 100644 index 00000000..305354e0 --- /dev/null +++ b/src/GitHub/Models/CodeSecurityConfiguration_dependency_graph_autosubmit_action_options.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Models { + /// + /// Feature options for Automatic dependency submission + /// + public class CodeSecurityConfiguration_dependency_graph_autosubmit_action_options : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public bool? LabeledRunners { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CodeSecurityConfiguration_dependency_graph_autosubmit_action_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CodeSecurityConfiguration_dependency_graph_autosubmit_action_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CodeSecurityConfiguration_dependency_graph_autosubmit_action_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"labeled_runners", n => { LabeledRunners = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("labeled_runners", LabeledRunners); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Models/CopilotSeatDetails.cs b/src/GitHub/Models/CopilotSeatDetails.cs index 3d6eb04f..f39f014e 100644 --- a/src/GitHub/Models/CopilotSeatDetails.cs +++ b/src/GitHub/Models/CopilotSeatDetails.cs @@ -96,100 +96,6 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); } /// - /// Composed type wrapper for classes , , - /// - public class CopilotSeatDetails_assignee : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public GitHub.Models.Organization? Organization { get; set; } -#nullable restore -#else - public GitHub.Models.Organization Organization { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public GitHub.Models.SimpleUser? SimpleUser { get; set; } -#nullable restore -#else - public GitHub.Models.SimpleUser SimpleUser { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public GitHub.Models.Team? Team { get; set; } -#nullable restore -#else - public GitHub.Models.Team Team { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static CopilotSeatDetails_assignee CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new CopilotSeatDetails_assignee(); - if("organization".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Organization = new GitHub.Models.Organization(); - } - else if("simple-user".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.SimpleUser = new GitHub.Models.SimpleUser(); - } - else if("team".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Team = new GitHub.Models.Team(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(Organization != null) - { - return Organization.GetFieldDeserializers(); - } - else if(SimpleUser != null) - { - return SimpleUser.GetFieldDeserializers(); - } - else if(Team != null) - { - return Team.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - if(Organization != null) - { - writer.WriteObjectValue(null, Organization); - } - else if(SimpleUser != null) - { - writer.WriteObjectValue(null, SimpleUser); - } - else if(Team != null) - { - writer.WriteObjectValue(null, Team); - } - } - } - /// /// Composed type wrapper for classes , /// public class CopilotSeatDetails_assigning_team : IComposedTypeWrapper, IParsable diff --git a/src/GitHub/Models/CopilotSeatDetails_assignee.cs b/src/GitHub/Models/CopilotSeatDetails_assignee.cs new file mode 100644 index 00000000..ca0f1af3 --- /dev/null +++ b/src/GitHub/Models/CopilotSeatDetails_assignee.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Models { + /// + /// The assignee that has been granted access to GitHub Copilot. + /// + public class CopilotSeatDetails_assignee : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CopilotSeatDetails_assignee() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CopilotSeatDetails_assignee CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CopilotSeatDetails_assignee(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Models/OrgCustomProperty.cs b/src/GitHub/Models/CustomProperty.cs similarity index 75% rename from src/GitHub/Models/OrgCustomProperty.cs rename to src/GitHub/Models/CustomProperty.cs index d26f7110..d5495b9b 100644 --- a/src/GitHub/Models/OrgCustomProperty.cs +++ b/src/GitHub/Models/CustomProperty.cs @@ -8,7 +8,7 @@ namespace GitHub.Models { /// /// Custom property defined on an organization /// - public class OrgCustomProperty : IAdditionalDataHolder, IParsable + public class CustomProperty : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } @@ -23,10 +23,10 @@ public class OrgCustomProperty : IAdditionalDataHolder, IParsable /// Default value of the property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OrgCustomProperty_default_value? DefaultValue { get; set; } + public CustomProperty_default_value? DefaultValue { get; set; } #nullable restore #else - public OrgCustomProperty_default_value DefaultValue { get; set; } + public CustomProperty_default_value DefaultValue { get; set; } #endif /// Short description of the property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -46,26 +46,34 @@ public class OrgCustomProperty : IAdditionalDataHolder, IParsable #endif /// Whether the property is required. public bool? Required { get; set; } + /// The URL that can be used to fetch, update, or delete info about this property via the API. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif /// Who can edit the values of the property - public OrgCustomProperty_values_editable_by? ValuesEditableBy { get; set; } + public CustomProperty_values_editable_by? ValuesEditableBy { get; set; } /// The type of the value for the property - public OrgCustomProperty_value_type? ValueType { get; set; } + public CustomProperty_value_type? ValueType { get; set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public OrgCustomProperty() + public CustomProperty() { AdditionalData = new Dictionary(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OrgCustomProperty CreateFromDiscriminatorValue(IParseNode parseNode) + public static CustomProperty CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OrgCustomProperty(); + return new CustomProperty(); } /// /// The deserialization information for the current model @@ -76,12 +84,13 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { {"allowed_values", n => { AllowedValues = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, - {"default_value", n => { DefaultValue = n.GetObjectValue(OrgCustomProperty_default_value.CreateFromDiscriminatorValue); } }, + {"default_value", n => { DefaultValue = n.GetObjectValue(CustomProperty_default_value.CreateFromDiscriminatorValue); } }, {"description", n => { Description = n.GetStringValue(); } }, {"property_name", n => { PropertyName = n.GetStringValue(); } }, {"required", n => { Required = n.GetBoolValue(); } }, - {"value_type", n => { ValueType = n.GetEnumValue(); } }, - {"values_editable_by", n => { ValuesEditableBy = n.GetEnumValue(); } }, + {"url", n => { Url = n.GetStringValue(); } }, + {"value_type", n => { ValueType = n.GetEnumValue(); } }, + {"values_editable_by", n => { ValuesEditableBy = n.GetEnumValue(); } }, }; } /// @@ -92,18 +101,19 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfPrimitiveValues("allowed_values", AllowedValues); - writer.WriteObjectValue("default_value", DefaultValue); + writer.WriteObjectValue("default_value", DefaultValue); writer.WriteStringValue("description", Description); writer.WriteStringValue("property_name", PropertyName); writer.WriteBoolValue("required", Required); - writer.WriteEnumValue("values_editable_by", ValuesEditableBy); - writer.WriteEnumValue("value_type", ValueType); + writer.WriteStringValue("url", Url); + writer.WriteEnumValue("values_editable_by", ValuesEditableBy); + writer.WriteEnumValue("value_type", ValueType); writer.WriteAdditionalData(AdditionalData); } /// /// Composed type wrapper for classes /// - public class OrgCustomProperty_default_value : IComposedTypeWrapper, IParsable + public class CustomProperty_default_value : IComposedTypeWrapper, IParsable { /// Composed type representation for type #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -116,13 +126,13 @@ public class OrgCustomProperty_default_value : IComposedTypeWrapper, IParsable /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OrgCustomProperty_default_value CreateFromDiscriminatorValue(IParseNode parseNode) + public static CustomProperty_default_value CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new OrgCustomProperty_default_value(); + var result = new CustomProperty_default_value(); if(parseNode.GetStringValue() is string stringValue) { result.String = stringValue; diff --git a/src/GitHub/Models/OrgCustomProperty_value_type.cs b/src/GitHub/Models/CustomProperty_value_type.cs similarity index 94% rename from src/GitHub/Models/OrgCustomProperty_value_type.cs rename to src/GitHub/Models/CustomProperty_value_type.cs index 12813f8d..cec6e70a 100644 --- a/src/GitHub/Models/OrgCustomProperty_value_type.cs +++ b/src/GitHub/Models/CustomProperty_value_type.cs @@ -3,7 +3,7 @@ using System; namespace GitHub.Models { /// The type of the value for the property - public enum OrgCustomProperty_value_type + public enum CustomProperty_value_type { [EnumMember(Value = "string")] #pragma warning disable CS1591 diff --git a/src/GitHub/Models/OrgCustomProperty_values_editable_by.cs b/src/GitHub/Models/CustomProperty_values_editable_by.cs similarity index 90% rename from src/GitHub/Models/OrgCustomProperty_values_editable_by.cs rename to src/GitHub/Models/CustomProperty_values_editable_by.cs index e44053d0..60746356 100644 --- a/src/GitHub/Models/OrgCustomProperty_values_editable_by.cs +++ b/src/GitHub/Models/CustomProperty_values_editable_by.cs @@ -3,7 +3,7 @@ using System; namespace GitHub.Models { /// Who can edit the values of the property - public enum OrgCustomProperty_values_editable_by + public enum CustomProperty_values_editable_by { [EnumMember(Value = "org_actors")] #pragma warning disable CS1591 diff --git a/src/GitHub/Models/Organization.cs b/src/GitHub/Models/Organization.cs deleted file mode 100644 index 33d521e2..00000000 --- a/src/GitHub/Models/Organization.cs +++ /dev/null @@ -1,282 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace GitHub.Models { - /// - /// GitHub account for managing multiple users, teams, and repositories - /// - public class Organization : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The avatar_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? AvatarUrl { get; set; } -#nullable restore -#else - public string AvatarUrl { get; set; } -#endif - /// Display blog url for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Blog { get; set; } -#nullable restore -#else - public string Blog { get; set; } -#endif - /// Display company name for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Company { get; set; } -#nullable restore -#else - public string Company { get; set; } -#endif - /// The created_at property - public DateTimeOffset? CreatedAt { get; set; } - /// The description property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Description { get; set; } -#nullable restore -#else - public string Description { get; set; } -#endif - /// Display email for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Email { get; set; } -#nullable restore -#else - public string Email { get; set; } -#endif - /// The events_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? EventsUrl { get; set; } -#nullable restore -#else - public string EventsUrl { get; set; } -#endif - /// The followers property - public int? Followers { get; set; } - /// The following property - public int? Following { get; set; } - /// Specifies if organization projects are enabled for this org - public bool? HasOrganizationProjects { get; set; } - /// Specifies if repository projects are enabled for repositories that belong to this org - public bool? HasRepositoryProjects { get; set; } - /// The hooks_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? HooksUrl { get; set; } -#nullable restore -#else - public string HooksUrl { get; set; } -#endif - /// The html_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? HtmlUrl { get; set; } -#nullable restore -#else - public string HtmlUrl { get; set; } -#endif - /// The id property - public int? Id { get; set; } - /// The issues_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? IssuesUrl { get; set; } -#nullable restore -#else - public string IssuesUrl { get; set; } -#endif - /// The is_verified property - public bool? IsVerified { get; set; } - /// Display location for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Location { get; set; } -#nullable restore -#else - public string Location { get; set; } -#endif - /// Unique login name of the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Login { get; set; } -#nullable restore -#else - public string Login { get; set; } -#endif - /// The members_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? MembersUrl { get; set; } -#nullable restore -#else - public string MembersUrl { get; set; } -#endif - /// Display name for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Name { get; set; } -#nullable restore -#else - public string Name { get; set; } -#endif - /// The node_id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? NodeId { get; set; } -#nullable restore -#else - public string NodeId { get; set; } -#endif - /// The plan property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Organization_plan? Plan { get; set; } -#nullable restore -#else - public Organization_plan Plan { get; set; } -#endif - /// The public_gists property - public int? PublicGists { get; set; } - /// The public_members_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? PublicMembersUrl { get; set; } -#nullable restore -#else - public string PublicMembersUrl { get; set; } -#endif - /// The public_repos property - public int? PublicRepos { get; set; } - /// The repos_url property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? ReposUrl { get; set; } -#nullable restore -#else - public string ReposUrl { get; set; } -#endif - /// The type property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Type { get; set; } -#nullable restore -#else - public string Type { get; set; } -#endif - /// The updated_at property - public DateTimeOffset? UpdatedAt { get; set; } - /// URL for the organization -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Url { get; set; } -#nullable restore -#else - public string Url { get; set; } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public Organization() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Organization CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Organization(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"avatar_url", n => { AvatarUrl = n.GetStringValue(); } }, - {"blog", n => { Blog = n.GetStringValue(); } }, - {"company", n => { Company = n.GetStringValue(); } }, - {"created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, - {"description", n => { Description = n.GetStringValue(); } }, - {"email", n => { Email = n.GetStringValue(); } }, - {"events_url", n => { EventsUrl = n.GetStringValue(); } }, - {"followers", n => { Followers = n.GetIntValue(); } }, - {"following", n => { Following = n.GetIntValue(); } }, - {"has_organization_projects", n => { HasOrganizationProjects = n.GetBoolValue(); } }, - {"has_repository_projects", n => { HasRepositoryProjects = n.GetBoolValue(); } }, - {"hooks_url", n => { HooksUrl = n.GetStringValue(); } }, - {"html_url", n => { HtmlUrl = n.GetStringValue(); } }, - {"id", n => { Id = n.GetIntValue(); } }, - {"is_verified", n => { IsVerified = n.GetBoolValue(); } }, - {"issues_url", n => { IssuesUrl = n.GetStringValue(); } }, - {"location", n => { Location = n.GetStringValue(); } }, - {"login", n => { Login = n.GetStringValue(); } }, - {"members_url", n => { MembersUrl = n.GetStringValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, - {"node_id", n => { NodeId = n.GetStringValue(); } }, - {"plan", n => { Plan = n.GetObjectValue(Organization_plan.CreateFromDiscriminatorValue); } }, - {"public_gists", n => { PublicGists = n.GetIntValue(); } }, - {"public_members_url", n => { PublicMembersUrl = n.GetStringValue(); } }, - {"public_repos", n => { PublicRepos = n.GetIntValue(); } }, - {"repos_url", n => { ReposUrl = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, - {"updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, - {"url", n => { Url = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("avatar_url", AvatarUrl); - writer.WriteStringValue("blog", Blog); - writer.WriteStringValue("company", Company); - writer.WriteDateTimeOffsetValue("created_at", CreatedAt); - writer.WriteStringValue("description", Description); - writer.WriteStringValue("email", Email); - writer.WriteStringValue("events_url", EventsUrl); - writer.WriteIntValue("followers", Followers); - writer.WriteIntValue("following", Following); - writer.WriteBoolValue("has_organization_projects", HasOrganizationProjects); - writer.WriteBoolValue("has_repository_projects", HasRepositoryProjects); - writer.WriteStringValue("hooks_url", HooksUrl); - writer.WriteStringValue("html_url", HtmlUrl); - writer.WriteIntValue("id", Id); - writer.WriteStringValue("issues_url", IssuesUrl); - writer.WriteBoolValue("is_verified", IsVerified); - writer.WriteStringValue("location", Location); - writer.WriteStringValue("login", Login); - writer.WriteStringValue("members_url", MembersUrl); - writer.WriteStringValue("name", Name); - writer.WriteStringValue("node_id", NodeId); - writer.WriteObjectValue("plan", Plan); - writer.WriteIntValue("public_gists", PublicGists); - writer.WriteStringValue("public_members_url", PublicMembersUrl); - writer.WriteIntValue("public_repos", PublicRepos); - writer.WriteStringValue("repos_url", ReposUrl); - writer.WriteStringValue("type", Type); - writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); - writer.WriteStringValue("url", Url); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/GitHub/Models/RepositoryRulesetBypassActor_actor_type.cs b/src/GitHub/Models/RepositoryRulesetBypassActor_actor_type.cs index 50c257f2..0b2fdcdb 100644 --- a/src/GitHub/Models/RepositoryRulesetBypassActor_actor_type.cs +++ b/src/GitHub/Models/RepositoryRulesetBypassActor_actor_type.cs @@ -25,5 +25,9 @@ public enum RepositoryRulesetBypassActor_actor_type #pragma warning disable CS1591 DeployKey, #pragma warning restore CS1591 + [EnumMember(Value = "EnterpriseTeam")] + #pragma warning disable CS1591 + EnterpriseTeam, + #pragma warning restore CS1591 } } diff --git a/src/GitHub/Models/Organization_plan.cs b/src/GitHub/Models/SecretScanningPushProtectionBypass.cs similarity index 55% rename from src/GitHub/Models/Organization_plan.cs rename to src/GitHub/Models/SecretScanningPushProtectionBypass.cs index 9656b504..287c9b58 100644 --- a/src/GitHub/Models/Organization_plan.cs +++ b/src/GitHub/Models/SecretScanningPushProtectionBypass.cs @@ -6,43 +6,39 @@ using System; namespace GitHub.Models { #pragma warning disable CS1591 - public class Organization_plan : IAdditionalDataHolder, IParsable + public class SecretScanningPushProtectionBypass : IAdditionalDataHolder, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The filled_seats property - public int? FilledSeats { get; set; } - /// The name property + /// The time that the bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + public DateTimeOffset? ExpireAt { get; set; } + /// The reason for bypassing push protection. + public SecretScanningPushProtectionBypassReason? Reason { get; set; } + /// The token type this bypass is for. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { get; set; } + public string? TokenType { get; set; } #nullable restore #else - public string Name { get; set; } + public string TokenType { get; set; } #endif - /// The private_repos property - public int? PrivateRepos { get; set; } - /// The seats property - public int? Seats { get; set; } - /// The space property - public int? Space { get; set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public Organization_plan() + public SecretScanningPushProtectionBypass() { AdditionalData = new Dictionary(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static Organization_plan CreateFromDiscriminatorValue(IParseNode parseNode) + public static SecretScanningPushProtectionBypass CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Organization_plan(); + return new SecretScanningPushProtectionBypass(); } /// /// The deserialization information for the current model @@ -52,11 +48,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"filled_seats", n => { FilledSeats = n.GetIntValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, - {"private_repos", n => { PrivateRepos = n.GetIntValue(); } }, - {"seats", n => { Seats = n.GetIntValue(); } }, - {"space", n => { Space = n.GetIntValue(); } }, + {"expire_at", n => { ExpireAt = n.GetDateTimeOffsetValue(); } }, + {"reason", n => { Reason = n.GetEnumValue(); } }, + {"token_type", n => { TokenType = n.GetStringValue(); } }, }; } /// @@ -66,11 +60,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteIntValue("filled_seats", FilledSeats); - writer.WriteStringValue("name", Name); - writer.WriteIntValue("private_repos", PrivateRepos); - writer.WriteIntValue("seats", Seats); - writer.WriteIntValue("space", Space); + writer.WriteDateTimeOffsetValue("expire_at", ExpireAt); + writer.WriteEnumValue("reason", Reason); + writer.WriteStringValue("token_type", TokenType); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Models/SecretScanningPushProtectionBypass503Error.cs b/src/GitHub/Models/SecretScanningPushProtectionBypass503Error.cs new file mode 100644 index 00000000..d926a0e3 --- /dev/null +++ b/src/GitHub/Models/SecretScanningPushProtectionBypass503Error.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Models { + #pragma warning disable CS1591 + public class SecretScanningPushProtectionBypass503Error : ApiException, IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// The documentation_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DocumentationUrl { get; set; } +#nullable restore +#else + public string DocumentationUrl { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageEscaped { get; set; } +#nullable restore +#else + public string MessageEscaped { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SecretScanningPushProtectionBypass503Error() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SecretScanningPushProtectionBypass503Error CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SecretScanningPushProtectionBypass503Error(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"code", n => { Code = n.GetStringValue(); } }, + {"documentation_url", n => { DocumentationUrl = n.GetStringValue(); } }, + {"message", n => { MessageEscaped = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("documentation_url", DocumentationUrl); + writer.WriteStringValue("message", MessageEscaped); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Models/SecretScanningPushProtectionBypassReason.cs b/src/GitHub/Models/SecretScanningPushProtectionBypassReason.cs new file mode 100644 index 00000000..33f542a0 --- /dev/null +++ b/src/GitHub/Models/SecretScanningPushProtectionBypassReason.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models { + /// The reason for bypassing push protection. + public enum SecretScanningPushProtectionBypassReason + { + [EnumMember(Value = "false_positive")] + #pragma warning disable CS1591 + False_positive, + #pragma warning restore CS1591 + [EnumMember(Value = "used_in_tests")] + #pragma warning disable CS1591 + Used_in_tests, + #pragma warning restore CS1591 + [EnumMember(Value = "will_fix_later")] + #pragma warning disable CS1591 + Will_fix_later, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/Users.cs b/src/GitHub/Models/Users.cs index 837adc14..826a2835 100644 --- a/src/GitHub/Models/Users.cs +++ b/src/GitHub/Models/Users.cs @@ -11,23 +11,45 @@ public class Users : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Whether this email address is the primary address. - public bool? Primary { get; set; } - /// The type of email address. + /// The fragment property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { get; set; } + public string? Fragment { get; set; } #nullable restore #else - public string Type { get; set; } + public string Fragment { get; set; } #endif - /// The email address. + /// The matches property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { get; set; } + public List? Matches { get; set; } #nullable restore #else - public string Value { get; set; } + public List Matches { get; set; } +#endif + /// The object_type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ObjectType { get; set; } +#nullable restore +#else + public string ObjectType { get; set; } +#endif + /// The object_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ObjectUrl { get; set; } +#nullable restore +#else + public string ObjectUrl { get; set; } +#endif + /// The property property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Property { get; set; } +#nullable restore +#else + public string Property { get; set; } #endif /// /// Instantiates a new and sets the default values. @@ -54,9 +76,11 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"primary", n => { Primary = n.GetBoolValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, - {"value", n => { Value = n.GetStringValue(); } }, + {"fragment", n => { Fragment = n.GetStringValue(); } }, + {"matches", n => { Matches = n.GetCollectionOfObjectValues(Users_matches.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object_type", n => { ObjectType = n.GetStringValue(); } }, + {"object_url", n => { ObjectUrl = n.GetStringValue(); } }, + {"property", n => { Property = n.GetStringValue(); } }, }; } /// @@ -66,9 +90,11 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteBoolValue("primary", Primary); - writer.WriteStringValue("type", Type); - writer.WriteStringValue("value", Value); + writer.WriteStringValue("fragment", Fragment); + writer.WriteCollectionOfObjectValues("matches", Matches); + writer.WriteStringValue("object_type", ObjectType); + writer.WriteStringValue("object_url", ObjectUrl); + writer.WriteStringValue("property", Property); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Models/Users_matches.cs b/src/GitHub/Models/Users_matches.cs new file mode 100644 index 00000000..31bc160c --- /dev/null +++ b/src/GitHub/Models/Users_matches.cs @@ -0,0 +1,71 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Models { + #pragma warning disable CS1591 + public class Users_matches : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The indices property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Indices { get; set; } +#nullable restore +#else + public List Indices { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Users_matches() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Users_matches CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Users_matches(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"indices", n => { Indices = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("indices", Indices); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs index 488814f1..59e45ebb 100644 --- a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs @@ -19,6 +19,16 @@ public class ConfigurationsPostRequestBody : IParsable public ConfigurationsPostRequestBody_dependabot_security_updates? DependabotSecurityUpdates { get; set; } /// The enablement status of Dependency Graph public ConfigurationsPostRequestBody_dependency_graph? DependencyGraph { get; set; } + /// The enablement status of Automatic dependency submission + public ConfigurationsPostRequestBody_dependency_graph_autosubmit_action? DependencyGraphAutosubmitAction { get; set; } + /// Feature options for Automatic dependency submission +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options? DependencyGraphAutosubmitActionOptions { get; set; } +#nullable restore +#else + public ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options DependencyGraphAutosubmitActionOptions { get; set; } +#endif /// A description of the code security configuration #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -55,6 +65,7 @@ public ConfigurationsPostRequestBody() DependabotAlerts = ConfigurationsPostRequestBody_dependabot_alerts.Disabled; DependabotSecurityUpdates = ConfigurationsPostRequestBody_dependabot_security_updates.Disabled; DependencyGraph = ConfigurationsPostRequestBody_dependency_graph.Enabled; + DependencyGraphAutosubmitAction = ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.Disabled; Enforcement = ConfigurationsPostRequestBody_enforcement.Enforced; PrivateVulnerabilityReporting = ConfigurationsPostRequestBody_private_vulnerability_reporting.Disabled; SecretScanning = ConfigurationsPostRequestBody_secret_scanning.Disabled; @@ -84,6 +95,8 @@ public virtual IDictionary> GetFieldDeserializers() {"dependabot_alerts", n => { DependabotAlerts = n.GetEnumValue(); } }, {"dependabot_security_updates", n => { DependabotSecurityUpdates = n.GetEnumValue(); } }, {"dependency_graph", n => { DependencyGraph = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action", n => { DependencyGraphAutosubmitAction = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action_options", n => { DependencyGraphAutosubmitActionOptions = n.GetObjectValue(ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.CreateFromDiscriminatorValue); } }, {"description", n => { Description = n.GetStringValue(); } }, {"enforcement", n => { Enforcement = n.GetEnumValue(); } }, {"name", n => { Name = n.GetStringValue(); } }, @@ -105,6 +118,8 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteEnumValue("dependabot_alerts", DependabotAlerts); writer.WriteEnumValue("dependabot_security_updates", DependabotSecurityUpdates); writer.WriteEnumValue("dependency_graph", DependencyGraph); + writer.WriteEnumValue("dependency_graph_autosubmit_action", DependencyGraphAutosubmitAction); + writer.WriteObjectValue("dependency_graph_autosubmit_action_options", DependencyGraphAutosubmitActionOptions); writer.WriteStringValue("description", Description); writer.WriteEnumValue("enforcement", Enforcement); writer.WriteStringValue("name", Name); diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs new file mode 100644 index 00000000..1ab6eed1 --- /dev/null +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.CodeSecurity.Configurations { + /// The enablement status of Automatic dependency submission + public enum ConfigurationsPostRequestBody_dependency_graph_autosubmit_action + { + [EnumMember(Value = "enabled")] + #pragma warning disable CS1591 + Enabled, + #pragma warning restore CS1591 + [EnumMember(Value = "disabled")] + #pragma warning disable CS1591 + Disabled, + #pragma warning restore CS1591 + [EnumMember(Value = "not_set")] + #pragma warning disable CS1591 + Not_set, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs new file mode 100644 index 00000000..54e7a595 --- /dev/null +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Orgs.Item.CodeSecurity.Configurations { + /// + /// Feature options for Automatic dependency submission + /// + public class ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public bool? LabeledRunners { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"labeled_runners", n => { LabeledRunners = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("labeled_runners", LabeledRunners); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs index 1243b95e..d1036f61 100644 --- a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs @@ -19,6 +19,16 @@ public class WithConfiguration_PatchRequestBody : IParsable public WithConfiguration_PatchRequestBody_dependabot_security_updates? DependabotSecurityUpdates { get; set; } /// The enablement status of Dependency Graph public WithConfiguration_PatchRequestBody_dependency_graph? DependencyGraph { get; set; } + /// The enablement status of Automatic dependency submission + public WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action? DependencyGraphAutosubmitAction { get; set; } + /// Feature options for Automatic dependency submission +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options? DependencyGraphAutosubmitActionOptions { get; set; } +#nullable restore +#else + public WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options DependencyGraphAutosubmitActionOptions { get; set; } +#endif /// A description of the code security configuration #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -68,6 +78,8 @@ public virtual IDictionary> GetFieldDeserializers() {"dependabot_alerts", n => { DependabotAlerts = n.GetEnumValue(); } }, {"dependabot_security_updates", n => { DependabotSecurityUpdates = n.GetEnumValue(); } }, {"dependency_graph", n => { DependencyGraph = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action", n => { DependencyGraphAutosubmitAction = n.GetEnumValue(); } }, + {"dependency_graph_autosubmit_action_options", n => { DependencyGraphAutosubmitActionOptions = n.GetObjectValue(WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.CreateFromDiscriminatorValue); } }, {"description", n => { Description = n.GetStringValue(); } }, {"enforcement", n => { Enforcement = n.GetEnumValue(); } }, {"name", n => { Name = n.GetStringValue(); } }, @@ -89,6 +101,8 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteEnumValue("dependabot_alerts", DependabotAlerts); writer.WriteEnumValue("dependabot_security_updates", DependabotSecurityUpdates); writer.WriteEnumValue("dependency_graph", DependencyGraph); + writer.WriteEnumValue("dependency_graph_autosubmit_action", DependencyGraphAutosubmitAction); + writer.WriteObjectValue("dependency_graph_autosubmit_action_options", DependencyGraphAutosubmitActionOptions); writer.WriteStringValue("description", Description); writer.WriteEnumValue("enforcement", Enforcement); writer.WriteStringValue("name", Name); diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs new file mode 100644 index 00000000..df932b58 --- /dev/null +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.CodeSecurity.Configurations.Item { + /// The enablement status of Automatic dependency submission + public enum WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action + { + [EnumMember(Value = "enabled")] + #pragma warning disable CS1591 + Enabled, + #pragma warning restore CS1591 + [EnumMember(Value = "disabled")] + #pragma warning disable CS1591 + Disabled, + #pragma warning restore CS1591 + [EnumMember(Value = "not_set")] + #pragma warning disable CS1591 + Not_set, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs new file mode 100644 index 00000000..4622a8d5 --- /dev/null +++ b/src/GitHub/Orgs/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Orgs.Item.CodeSecurity.Configurations.Item { + /// + /// Feature options for Automatic dependency submission + /// + public class WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public bool? LabeledRunners { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"labeled_runners", n => { LabeledRunners = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("labeled_runners", LabeledRunners); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Orgs/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Orgs/Item/Copilot/Usage/UsageRequestBuilder.cs index 893d6ff8..ef1d273d 100644 --- a/src/GitHub/Orgs/Item/Copilot/Usage/UsageRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Copilot/Usage/UsageRequestBuilder.cs @@ -31,7 +31,7 @@ public UsageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base { } /// - /// > [!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 IDEacross an organization, 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// > [!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 IDEacross an organization, 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 up to 28 days prior. 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// API method documentation /// /// A List<CopilotUsageMetrics> @@ -62,7 +62,7 @@ public async Task> GetAsync(Action - /// > [!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 IDEacross an organization, 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// > [!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 IDEacross an organization, 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 up to 28 days prior. 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -90,7 +90,7 @@ public UsageRequestBuilder WithUrl(string rawUrl) return new UsageRequestBuilder(rawUrl, RequestAdapter); } /// - /// > [!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 IDEacross an organization, 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// > [!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 IDEacross an organization, 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 up to 28 days prior. 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.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. /// public class UsageRequestBuilderGetQueryParameters { diff --git a/src/GitHub/Orgs/Item/Invitations/Item/Teams/TeamsRequestBuilder.cs b/src/GitHub/Orgs/Item/Invitations/Item/Teams/TeamsRequestBuilder.cs index bc6b1e66..f9e416cd 100644 --- a/src/GitHub/Orgs/Item/Invitations/Item/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Invitations/Item/Teams/TeamsRequestBuilder.cs @@ -34,7 +34,7 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// List all teams associated with an invitation. In order to see invitationsin an organization, the authenticated user must be an organization owner.This endpoint is not available for [Enterprise Managed User (EMU) organizations](https://docs.github.com/enterprise-cloud@latest//admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users). /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 404 status code diff --git a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_nameItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_nameItemRequestBuilder.cs index 3c7dc6d0..f8f8fa8e 100644 --- a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_nameItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_nameItemRequestBuilder.cs @@ -59,18 +59,18 @@ public async Task DeleteAsync(Action /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 403 status code /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); @@ -79,13 +79,13 @@ public async Task GetAsync(Action(requestInfo, OrgCustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, CustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new or updates an existing custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// API method documentation /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. @@ -93,11 +93,11 @@ public async Task GetAsync(ActionWhen receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PutAsync(WithCustom_property_namePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PutAsync(WithCustom_property_namePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PutAsync(WithCustom_property_namePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PutAsync(WithCustom_property_namePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -107,7 +107,7 @@ public async Task PutAsync(WithCustom_property_namePutRequest {"403", BasicError.CreateFromDiscriminatorValue}, {"404", BasicError.CreateFromDiscriminatorValue}, }; - return await RequestAdapter.SendAsync(requestInfo, OrgCustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, CustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Removes a custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. diff --git a/src/GitHub/Orgs/Item/Properties/Schema/SchemaPatchRequestBody.cs b/src/GitHub/Orgs/Item/Properties/Schema/SchemaPatchRequestBody.cs index 1a4dc403..7bf972d7 100644 --- a/src/GitHub/Orgs/Item/Properties/Schema/SchemaPatchRequestBody.cs +++ b/src/GitHub/Orgs/Item/Properties/Schema/SchemaPatchRequestBody.cs @@ -15,10 +15,10 @@ public class SchemaPatchRequestBody : IAdditionalDataHolder, IParsable /// The array of custom properties to create or update. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Properties { get; set; } + public List? Properties { get; set; } #nullable restore #else - public List Properties { get; set; } + public List Properties { get; set; } #endif /// /// Instantiates a new and sets the default values. @@ -45,7 +45,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"properties", n => { Properties = n.GetCollectionOfObjectValues(OrgCustomProperty.CreateFromDiscriminatorValue)?.ToList(); } }, + {"properties", n => { Properties = n.GetCollectionOfObjectValues(CustomProperty.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -55,7 +55,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("properties", Properties); + writer.WriteCollectionOfObjectValues("properties", Properties); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Orgs/Item/Properties/Schema/SchemaRequestBuilder.cs b/src/GitHub/Orgs/Item/Properties/Schema/SchemaRequestBuilder.cs index be3a10da..aaf416b5 100644 --- a/src/GitHub/Orgs/Item/Properties/Schema/SchemaRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Properties/Schema/SchemaRequestBuilder.cs @@ -47,18 +47,18 @@ public SchemaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// Gets all custom properties defined for an organization.Organization members can read these properties. /// API method documentation /// - /// A List<OrgCustomProperty> + /// A List<CustomProperty> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 403 status code /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); @@ -67,14 +67,14 @@ public async Task> GetAsync(Action(requestInfo, OrgCustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// /// Creates new or updates existing custom properties defined for an organization in a batch.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// API method documentation /// - /// A List<OrgCustomProperty> + /// A List<CustomProperty> /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. @@ -82,11 +82,11 @@ public async Task> GetAsync(ActionWhen receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> PatchAsync(SchemaPatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> PatchAsync(SchemaPatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> PatchAsync(SchemaPatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> PatchAsync(SchemaPatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -96,7 +96,7 @@ public async Task> PatchAsync(SchemaPatchRequestBody bod {"403", BasicError.CreateFromDiscriminatorValue}, {"404", BasicError.CreateFromDiscriminatorValue}, }; - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, OrgCustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CustomProperty.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// diff --git a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody.cs b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody.cs index 81daac7c..a58979af 100644 --- a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody.cs +++ b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody.cs @@ -75,7 +75,7 @@ public class ReposPostRequestBody : IAdditionalDataHolder, IParsable #endif /// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. public ReposPostRequestBody_merge_commit_message? MergeCommitMessage { get; set; } - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public ReposPostRequestBody_merge_commit_title? MergeCommitTitle { get; set; } /// The name of the repository. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -89,7 +89,7 @@ public class ReposPostRequestBody : IAdditionalDataHolder, IParsable public bool? Private { get; set; } /// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. public ReposPostRequestBody_squash_merge_commit_message? SquashMergeCommitMessage { get; set; } - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public ReposPostRequestBody_squash_merge_commit_title? SquashMergeCommitTitle { get; set; } /// The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. public int? TeamId { get; set; } diff --git a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_merge_commit_title.cs b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_merge_commit_title.cs index 92c8c849..40d4c094 100644 --- a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_merge_commit_title.cs +++ b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.Orgs.Item.Repos { - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public enum ReposPostRequestBody_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_squash_merge_commit_title.cs b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_squash_merge_commit_title.cs index 4588477f..11c74af6 100644 --- a/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_squash_merge_commit_title.cs +++ b/src/GitHub/Orgs/Item/Repos/ReposPostRequestBody_squash_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.Orgs.Item.Repos { - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public enum ReposPostRequestBody_squash_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs index 735e1843..88198c33 100644 --- a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs @@ -56,7 +56,7 @@ public async Task DeleteAsync(Action - /// Get a repository ruleset for an organization. + /// Get a repository ruleset for an organization.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. /// API method documentation /// /// A @@ -129,7 +129,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Get a repository ruleset for an organization. + /// Get a repository ruleset for an organization.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/GitHub/Orgs/Item/Team/Item/Copilot/CopilotRequestBuilder.cs b/src/GitHub/Orgs/Item/Team/Item/Copilot/CopilotRequestBuilder.cs new file mode 100644 index 00000000..cbd55e3f --- /dev/null +++ b/src/GitHub/Orgs/Item/Team/Item/Copilot/CopilotRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using GitHub.Orgs.Item.Team.Item.Copilot.Usage; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Orgs.Item.Team.Item.Copilot { + /// + /// Builds and executes requests for operations under \orgs\{org}\team\{team_slug}\copilot + /// + public class CopilotRequestBuilder : BaseRequestBuilder + { + /// The usage property + public UsageRequestBuilder Usage + { + get => new UsageRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CopilotRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CopilotRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot", rawUrl) + { + } + } +} diff --git a/src/GitHub/Orgs/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Orgs/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs new file mode 100644 index 00000000..60707071 --- /dev/null +++ b/src/GitHub/Orgs/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.Team.Item.Copilot.Usage { + /// + /// Builds and executes requests for operations under \orgs\{org}\team\{team_slug}\copilot\usage + /// + public class UsageRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UsageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UsageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot/usage{?page*,per_page*,since*,until*}", rawUrl) + { + } + /// + /// > [!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 IDEfor 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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// API method documentation + /// + /// A List<CopilotUsageMetrics> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 500 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + {"401", BasicError.CreateFromDiscriminatorValue}, + {"403", BasicError.CreateFromDiscriminatorValue}, + {"404", BasicError.CreateFromDiscriminatorValue}, + {"500", BasicError.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CopilotUsageMetrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// > [!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 IDEfor 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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public UsageRequestBuilder WithUrl(string rawUrl) + { + return new UsageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// > [!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 IDEfor 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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + public class UsageRequestBuilderGetQueryParameters + { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-cloud@latest//rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("page")] + public int? Page { get; set; } + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-cloud@latest//rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// 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. +#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 + /// 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. +#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 + } + } +} diff --git a/src/GitHub/Orgs/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs new file mode 100644 index 00000000..93b53a52 --- /dev/null +++ b/src/GitHub/Orgs/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using GitHub.Orgs.Item.Team.Item.Copilot; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Orgs.Item.Team.Item { + /// + /// Builds and executes requests for operations under \orgs\{org}\team\{team_slug} + /// + public class WithTeam_slugItemRequestBuilder : BaseRequestBuilder + { + /// The copilot property + public CopilotRequestBuilder Copilot + { + get => new CopilotRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTeam_slugItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTeam_slugItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}", rawUrl) + { + } + } +} diff --git a/src/GitHub/Orgs/Item/Team/TeamRequestBuilder.cs b/src/GitHub/Orgs/Item/Team/TeamRequestBuilder.cs new file mode 100644 index 00000000..3b8052a6 --- /dev/null +++ b/src/GitHub/Orgs/Item/Team/TeamRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using GitHub.Orgs.Item.Team.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace GitHub.Orgs.Item.Team { + /// + /// Builds and executes requests for operations under \orgs\{org}\team + /// + public class TeamRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the GitHub.orgs.item.team.item collection + /// The slug of the team name. + /// A + public WithTeam_slugItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("team_slug", position); + return new WithTeam_slugItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeamRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/team", rawUrl) + { + } + } +} diff --git a/src/GitHub/Orgs/Item/Teams/Item/Teams/TeamsRequestBuilder.cs b/src/GitHub/Orgs/Item/Teams/Item/Teams/TeamsRequestBuilder.cs index 357ebb3f..64a0fc49 100644 --- a/src/GitHub/Orgs/Item/Teams/Item/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Teams/Item/Teams/TeamsRequestBuilder.cs @@ -34,7 +34,7 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// Lists the child teams of the team specified by `{team_slug}`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER diff --git a/src/GitHub/Orgs/Item/Teams/TeamsRequestBuilder.cs b/src/GitHub/Orgs/Item/Teams/TeamsRequestBuilder.cs index e4aae833..b586d6a9 100644 --- a/src/GitHub/Orgs/Item/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Teams/TeamsRequestBuilder.cs @@ -47,7 +47,7 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// Lists all teams in an organization that are visible to the authenticated user. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 403 status code diff --git a/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs b/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs index 9f326b95..b92241a9 100644 --- a/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs @@ -45,6 +45,7 @@ using GitHub.Orgs.Item.SecurityAdvisories; using GitHub.Orgs.Item.SecurityManagers; using GitHub.Orgs.Item.Settings; +using GitHub.Orgs.Item.Team; using GitHub.Orgs.Item.TeamSync; using GitHub.Orgs.Item.Teams; using Microsoft.Kiota.Abstractions.Serialization; @@ -281,6 +282,11 @@ public SettingsRequestBuilder Settings { get => new SettingsRequestBuilder(PathParameters, RequestAdapter); } + /// The team property + public TeamRequestBuilder Team + { + get => new TeamRequestBuilder(PathParameters, RequestAdapter); + } /// The teams property public TeamsRequestBuilder Teams { diff --git a/src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Teams/TeamsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Teams/TeamsRequestBuilder.cs index 0244f930..601332d5 100644 --- a/src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Teams/TeamsRequestBuilder.cs @@ -34,18 +34,18 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest//github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a team to push to this branch. You can also remove push access for child teams. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> DeleteAsync(TeamsDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> DeleteAsync(TeamsDeleteRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> DeleteAsync(TeamsDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> DeleteAsync(TeamsDeleteRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -54,24 +54,24 @@ public async Task> DeleteAsync(TeamsDeleteRequestBody body, Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// /// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest//github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the teams who have push access to this branch. The list includes child teams. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); @@ -79,25 +79,25 @@ public async Task> GetAsync(Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// /// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest//github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified teams push access for this branch. You can also give push access to child teams. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> PostAsync(TeamsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> PostAsync(TeamsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> PostAsync(TeamsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> PostAsync(TeamsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -106,25 +106,25 @@ public async Task> PostAsync(TeamsPostRequestBody body, Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// /// Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest//github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> PutAsync(TeamsPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> PutAsync(TeamsPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> PutAsync(TeamsPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> PutAsync(TeamsPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -133,7 +133,7 @@ public async Task> PutAsync(TeamsPutRequestBody body, Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// diff --git a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody.cs b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody.cs index 0f0d8974..ef059872 100644 --- a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody.cs +++ b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody.cs @@ -61,7 +61,7 @@ public class RepoPatchRequestBody : IAdditionalDataHolder, IParsable public bool? IsTemplate { get; set; } /// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. public RepoPatchRequestBody_merge_commit_message? MergeCommitMessage { get; set; } - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public RepoPatchRequestBody_merge_commit_title? MergeCommitTitle { get; set; } /// The name of the repository. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -83,7 +83,7 @@ public class RepoPatchRequestBody : IAdditionalDataHolder, IParsable #endif /// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. public RepoPatchRequestBody_squash_merge_commit_message? SquashMergeCommitMessage { get; set; } - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public RepoPatchRequestBody_squash_merge_commit_title? SquashMergeCommitTitle { get; set; } /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. [Obsolete("")] diff --git a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_merge_commit_title.cs b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_merge_commit_title.cs index 8de32c78..276f6271 100644 --- a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_merge_commit_title.cs +++ b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.Repos.Item.Item { - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public enum RepoPatchRequestBody_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_squash_merge_commit_title.cs b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_squash_merge_commit_title.cs index 1fc5f56f..616d1ac8 100644 --- a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_squash_merge_commit_title.cs +++ b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_squash_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.Repos.Item.Item { - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public enum RepoPatchRequestBody_squash_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/Repos/Item/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs index 177cb0a6..509ed7a3 100644 --- a/src/GitHub/Repos/Item/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Rulesets/Item/WithRuleset_ItemRequestBuilder.cs @@ -56,7 +56,7 @@ public async Task DeleteAsync(Action - /// Get a ruleset for a repository. + /// Get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. /// API method documentation /// /// A @@ -129,7 +129,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Get a ruleset for a repository. + /// Get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -179,7 +179,7 @@ public WithRuleset_ItemRequestBuilder WithUrl(string rawUrl) return new WithRuleset_ItemRequestBuilder(rawUrl, RequestAdapter); } /// - /// Get a ruleset for a repository. + /// Get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. /// public class WithRuleset_ItemRequestBuilderGetQueryParameters { diff --git a/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesPostRequestBody.cs b/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesPostRequestBody.cs new file mode 100644 index 00000000..05c179f8 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesPostRequestBody.cs @@ -0,0 +1,66 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.SecretScanning.PushProtectionBypasses { + #pragma warning disable CS1591 + public class PushProtectionBypassesPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaceholderId { get; set; } +#nullable restore +#else + public string PlaceholderId { get; set; } +#endif + /// The reason for bypassing push protection. + public SecretScanningPushProtectionBypassReason? Reason { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public PushProtectionBypassesPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PushProtectionBypassesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PushProtectionBypassesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"placeholder_id", n => { PlaceholderId = n.GetStringValue(); } }, + {"reason", n => { Reason = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("placeholder_id", PlaceholderId); + writer.WriteEnumValue("reason", Reason); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesRequestBuilder.cs b/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesRequestBuilder.cs new file mode 100644 index 00000000..48b7f698 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/SecretScanning/PushProtectionBypasses/PushProtectionBypassesRequestBuilder.cs @@ -0,0 +1,91 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.SecretScanning.PushProtectionBypasses { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\push-protection-bypasses + /// + public class PushProtectionBypassesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PushProtectionBypassesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/push-protection-bypasses", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PushProtectionBypassesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/push-protection-bypasses", rawUrl) + { + } + /// + /// Creates a bypass for a previously push protected secret.The authenticated user must be the original author of the committed secret.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// API method documentation + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 503 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PushProtectionBypassesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(PushProtectionBypassesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + {"503", SecretScanningPushProtectionBypass503Error.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, SecretScanningPushProtectionBypass.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a bypass for a previously push protected secret.The authenticated user must be the original author of the committed secret.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PushProtectionBypassesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PushProtectionBypassesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public PushProtectionBypassesRequestBuilder WithUrl(string rawUrl) + { + return new PushProtectionBypassesRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/SecretScanning/SecretScanningRequestBuilder.cs b/src/GitHub/Repos/Item/Item/SecretScanning/SecretScanningRequestBuilder.cs index f6015638..e0b22ed1 100644 --- a/src/GitHub/Repos/Item/Item/SecretScanning/SecretScanningRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/SecretScanning/SecretScanningRequestBuilder.cs @@ -1,5 +1,6 @@ // using GitHub.Repos.Item.Item.SecretScanning.Alerts; +using GitHub.Repos.Item.Item.SecretScanning.PushProtectionBypasses; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; using System.IO; @@ -17,6 +18,11 @@ public AlertsRequestBuilder Alerts { get => new AlertsRequestBuilder(PathParameters, RequestAdapter); } + /// The pushProtectionBypasses property + public PushProtectionBypassesRequestBuilder PushProtectionBypasses + { + get => new PushProtectionBypassesRequestBuilder(PathParameters, RequestAdapter); + } /// /// Instantiates a new and sets the default values. /// diff --git a/src/GitHub/Repos/Item/Item/Teams/TeamsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Teams/TeamsRequestBuilder.cs index b1d8a29f..b4ecbcf3 100644 --- a/src/GitHub/Repos/Item/Item/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Teams/TeamsRequestBuilder.cs @@ -34,17 +34,17 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// Lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); @@ -52,7 +52,7 @@ public async Task> GetAsync(Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// diff --git a/src/GitHub/Teams/Item/Teams/TeamsRequestBuilder.cs b/src/GitHub/Teams/Item/Teams/TeamsRequestBuilder.cs index ee9fefa3..b0e54439 100644 --- a/src/GitHub/Teams/Item/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Teams/Item/Teams/TeamsRequestBuilder.cs @@ -34,7 +34,7 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/enterprise-cloud@latest//rest/teams/teams#list-child-teams) endpoint. /// API method documentation /// - /// A List<Team> + /// A List<GitHub.Models.Team> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. /// When receiving a 403 status code @@ -43,11 +43,11 @@ public TeamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); @@ -57,7 +57,7 @@ public async Task> GetAsync(Action(requestInfo, Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GitHub.Models.Team.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); return collectionResult?.ToList(); } /// diff --git a/src/GitHub/User/Repos/ReposPostRequestBody.cs b/src/GitHub/User/Repos/ReposPostRequestBody.cs index be72513a..11db5b14 100644 --- a/src/GitHub/User/Repos/ReposPostRequestBody.cs +++ b/src/GitHub/User/Repos/ReposPostRequestBody.cs @@ -69,7 +69,7 @@ public class ReposPostRequestBody : IAdditionalDataHolder, IParsable #endif /// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. public ReposPostRequestBody_merge_commit_message? MergeCommitMessage { get; set; } - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public ReposPostRequestBody_merge_commit_title? MergeCommitTitle { get; set; } /// The name of the repository. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -83,7 +83,7 @@ public class ReposPostRequestBody : IAdditionalDataHolder, IParsable public bool? Private { get; set; } /// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. public ReposPostRequestBody_squash_merge_commit_message? SquashMergeCommitMessage { get; set; } - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public ReposPostRequestBody_squash_merge_commit_title? SquashMergeCommitTitle { get; set; } /// The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. public int? TeamId { get; set; } diff --git a/src/GitHub/User/Repos/ReposPostRequestBody_merge_commit_title.cs b/src/GitHub/User/Repos/ReposPostRequestBody_merge_commit_title.cs index 14e2f34e..68f87538 100644 --- a/src/GitHub/User/Repos/ReposPostRequestBody_merge_commit_title.cs +++ b/src/GitHub/User/Repos/ReposPostRequestBody_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.User.Repos { - /// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). public enum ReposPostRequestBody_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/User/Repos/ReposPostRequestBody_squash_merge_commit_title.cs b/src/GitHub/User/Repos/ReposPostRequestBody_squash_merge_commit_title.cs index b009ecc9..87120ffc 100644 --- a/src/GitHub/User/Repos/ReposPostRequestBody_squash_merge_commit_title.cs +++ b/src/GitHub/User/Repos/ReposPostRequestBody_squash_merge_commit_title.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System; namespace GitHub.User.Repos { - /// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). public enum ReposPostRequestBody_squash_merge_commit_title { [EnumMember(Value = "PR_TITLE")] diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 71a2abd1..447104b8 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "E8FBD3A11FF50B44A9E7653ACC1A5CE20EFFF5D016C2F9C5DA53ECBDC82271D422B00048AEAD3101C552B1F963A968DFF56590AF6061B81CAD5BBADD4A316AE3", + "descriptionHash": "E80A022AC58B86D4B8D12EDE3BF05DA3ABFEB1A340223788583E26D0130F2CAE3F5FA74F8D0D2F621B3903782D252D44ABC4CA943367CC8D9356A5AC02B72FBA", "descriptionLocation": "../../../../../schemas/ghec.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.14.0",