From 2c9557f8ebf594587abc6977f4045b5b3d1147df Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Mon, 23 Dec 2024 10:25:03 -0800 Subject: [PATCH] feat: Updates to generated code --- .../CodeSecurityRequestBuilder.cs} | 22 +- .../ConfigurationsPostRequestBody.cs | 152 +++++++++++++ ...ationsPostRequestBody_advanced_security.cs | 19 ++ ...RequestBody_code_scanning_default_setup.cs | 23 ++ ...ationsPostRequestBody_dependabot_alerts.cs | 23 ++ ...RequestBody_dependabot_security_updates.cs | 23 ++ ...rationsPostRequestBody_dependency_graph.cs | 23 ++ ...Body_dependency_graph_autosubmit_action.cs | 23 ++ ...endency_graph_autosubmit_action_options.cs | 60 +++++ ...nfigurationsPostRequestBody_enforcement.cs | 19 ++ ...estBody_private_vulnerability_reporting.cs | 23 ++ ...urationsPostRequestBody_secret_scanning.cs | 23 ++ ...y_secret_scanning_non_provider_patterns.cs | 23 ++ ...estBody_secret_scanning_push_protection.cs | 23 ++ ...estBody_secret_scanning_validity_checks.cs | 23 ++ .../ConfigurationsRequestBuilder.cs | 194 ++++++++++++++++ .../Defaults/DefaultsRequestBuilder.cs | 86 +++++++ .../Item/Attach/AttachPostRequestBody.cs | 49 ++++ .../Attach/AttachPostRequestBody_scope.cs | 19 ++ .../Item/Attach/AttachPostResponse.cs | 55 +++++ .../Item/Attach/AttachRequestBuilder.cs | 99 +++++++++ .../Item/Defaults/DefaultsPutRequestBody.cs | 59 +++++ ...ltsPutRequestBody_default_for_new_repos.cs | 27 +++ .../Item/Defaults/DefaultsPutResponse.cs | 70 ++++++ ...faultsPutResponse_default_for_new_repos.cs | 27 +++ .../Item/Defaults/DefaultsRequestBuilder.cs | 97 ++++++++ .../RepositoriesRequestBuilder.cs | 133 +++++++++++ .../WithConfiguration_ItemRequestBuilder.cs | 210 ++++++++++++++++++ .../WithConfiguration_PatchRequestBody.cs | 134 +++++++++++ ...tion_PatchRequestBody_advanced_security.cs | 19 ++ ...RequestBody_code_scanning_default_setup.cs | 23 ++ ...tion_PatchRequestBody_dependabot_alerts.cs | 23 ++ ...RequestBody_dependabot_security_updates.cs | 23 ++ ...ation_PatchRequestBody_dependency_graph.cs | 23 ++ ...Body_dependency_graph_autosubmit_action.cs | 23 ++ ...endency_graph_autosubmit_action_options.cs | 60 +++++ ...figuration_PatchRequestBody_enforcement.cs | 19 ++ ...estBody_private_vulnerability_reporting.cs | 23 ++ ...ration_PatchRequestBody_secret_scanning.cs | 23 ++ ...y_secret_scanning_non_provider_patterns.cs | 23 ++ ...estBody_secret_scanning_push_protection.cs | 23 ++ ...estBody_secret_scanning_validity_checks.cs | 23 ++ .../Billing/Seats/SeatsRequestBuilder.cs | 109 --------- .../Item/Copilot/CopilotRequestBuilder.cs | 53 ----- .../Copilot/Metrics/MetricsRequestBuilder.cs | 130 ----------- .../Item/Copilot/Usage/UsageRequestBuilder.cs | 130 ----------- .../Alerts/AlertsRequestBuilder.cs | 2 +- .../Item/Copilot/CopilotRequestBuilder.cs | 47 ---- .../Copilot/Metrics/MetricsRequestBuilder.cs | 130 ----------- .../Item/Copilot/Usage/UsageRequestBuilder.cs | 130 ----------- .../Item/WithTeam_slugItemRequestBuilder.cs | 41 ---- .../Item/Team/TeamRequestBuilder.cs | 48 ---- .../Item/WithEnterpriseItemRequestBuilder.cs | 14 +- src/GitHub/Models/ApiOverview_domains.cs | 10 + .../ApiOverview_domains_actions_inbound.cs | 75 +++++++ src/GitHub/Models/CodeScanningAutofix.cs | 72 ++++++ .../Models/CodeScanningAutofix503Error.cs | 88 ++++++++ .../Models/CodeScanningAutofixCommits.cs | 76 +++++++ .../CodeScanningAutofixCommitsResponse.cs | 75 +++++++ ...eScanningAutofixCommitsResponse503Error.cs | 88 ++++++++ .../Models/CodeScanningAutofixStatus.cs | 27 +++ ...odeScanningDefaultSetupUpdate_languages.cs | 4 + .../CodeScanningDefaultSetup_languages.cs | 4 + .../CustomPropertySetPayload.cs} | 61 ++--- .../CustomPropertySetPayload_value_type.cs} | 4 +- .../Models/OrgPrivateRegistryConfiguration.cs | 92 ++++++++ ...ryConfigurationWithSelectedRepositories.cs | 102 +++++++++ ...nWithSelectedRepositories_registry_type.cs | 15 ++ ...tionWithSelectedRepositories_visibility.cs | 23 ++ ...vateRegistryConfiguration_registry_type.cs | 15 ++ ...PrivateRegistryConfiguration_visibility.cs | 23 ++ src/GitHub/Models/OrgRulesetConditions.cs | 2 +- .../Models/OrganizationSecretScanningAlert.cs | 10 + .../Models/RateLimitOverview_resources.cs | 10 + .../RepositoryRulePullRequest_parameters.cs | 10 + .../Models/RepositoryRuleset_source_type.cs | 4 + src/GitHub/Models/RepositoryRuleset_target.cs | 4 + src/GitHub/Models/SecretScanningAlert.cs | 10 + ...hSubject_digestGetResponse_attestations.cs | 10 + .../Item/WithSecret_nameItemRequestBuilder.cs | 183 +++++++++++++++ .../Item/WithSecret_namePatchRequestBody.cs | 103 +++++++++ ...cret_namePatchRequestBody_registry_type.cs | 15 ++ ...hSecret_namePatchRequestBody_visibility.cs | 23 ++ .../PrivateRegistriesGetResponse.cs} | 32 +-- .../PrivateRegistriesPostRequestBody.cs | 103 +++++++++ ...RegistriesPostRequestBody_registry_type.cs | 15 ++ ...ateRegistriesPostRequestBody_visibility.cs | 23 ++ .../PrivateRegistriesRequestBuilder.cs | 174 +++++++++++++++ .../PublicKey/PublicKeyGetResponse.cs | 75 +++++++ .../PublicKey/PublicKeyRequestBuilder.cs | 90 ++++++++ ...hCustom_property_nameItemRequestBuilder.cs | 12 +- .../Item/WithRuleset_PutRequestBody.cs | 2 +- .../Item/WithRuleset_PutRequestBody_target.cs | 4 + .../Item/Rulesets/RulesetsPostRequestBody.cs | 2 +- .../RulesetsPostRequestBody_target.cs | 4 + .../Alerts/AlertsRequestBuilder.cs | 2 +- .../SecurityManagersRequestBuilder.cs | 8 +- .../Item/WithTeam_slugItemRequestBuilder.cs | 13 +- .../Teams/TeamsRequestBuilder.cs | 1 + .../Orgs/Item/WithOrgItemRequestBuilder.cs | 6 + ...hSubject_digestGetResponse_attestations.cs | 10 + .../Item/Autofix/AutofixRequestBuilder.cs | 151 +++++++++++++ .../Autofix/Commits/CommitsRequestBuilder.cs | 101 +++++++++ .../WithAlert_numberItemRequestBuilder.cs | 6 + .../Alerts/AlertsRequestBuilder.cs | 2 +- ...hSubject_digestGetResponse_attestations.cs | 10 + src/GitHub/kiota-lock.json | 2 +- 107 files changed, 4103 insertions(+), 906 deletions(-) rename src/GitHub/Enterprises/Item/{Copilot/Billing/BillingRequestBuilder.cs => CodeSecurity/CodeSecurityRequestBuilder.cs} (50%) create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_advanced_security.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_code_scanning_default_setup.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_alerts.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_security_updates.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_enforcement.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_private_vulnerability_reporting.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_push_protection.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_validity_checks.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Defaults/DefaultsRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody_scope.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostResponse.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody_default_for_new_repos.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse_default_for_new_repos.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Repositories/RepositoriesRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_ItemRequestBuilder.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_advanced_security.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_code_scanning_default_setup.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_alerts.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_security_updates.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_enforcement.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_private_vulnerability_reporting.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_push_protection.cs create mode 100644 src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_validity_checks.cs delete mode 100644 src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Copilot/CopilotRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Copilot/Metrics/MetricsRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Team/Item/Copilot/Metrics/MetricsRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs delete mode 100644 src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs create mode 100644 src/GitHub/Models/ApiOverview_domains_actions_inbound.cs create mode 100644 src/GitHub/Models/CodeScanningAutofix.cs create mode 100644 src/GitHub/Models/CodeScanningAutofix503Error.cs create mode 100644 src/GitHub/Models/CodeScanningAutofixCommits.cs create mode 100644 src/GitHub/Models/CodeScanningAutofixCommitsResponse.cs create mode 100644 src/GitHub/Models/CodeScanningAutofixCommitsResponse503Error.cs create mode 100644 src/GitHub/Models/CodeScanningAutofixStatus.cs rename src/GitHub/{Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody.cs => Models/CustomPropertySetPayload.cs} (62%) rename src/GitHub/{Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody_value_type.cs => Models/CustomPropertySetPayload_value_type.cs} (87%) create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfiguration.cs create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories.cs create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type.cs create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility.cs create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfiguration_registry_type.cs create mode 100644 src/GitHub/Models/OrgPrivateRegistryConfiguration_visibility.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_nameItemRequestBuilder.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_registry_type.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_visibility.cs rename src/GitHub/{Enterprises/Item/Copilot/Billing/Seats/SeatsGetResponse.cs => Orgs/Item/PrivateRegistries/PrivateRegistriesGetResponse.cs} (58%) create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_registry_type.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_visibility.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesRequestBuilder.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyGetResponse.cs create mode 100644 src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/AutofixRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/Commits/CommitsRequestBuilder.cs diff --git a/src/GitHub/Enterprises/Item/Copilot/Billing/BillingRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/CodeSecurityRequestBuilder.cs similarity index 50% rename from src/GitHub/Enterprises/Item/Copilot/Billing/BillingRequestBuilder.cs rename to src/GitHub/Enterprises/Item/CodeSecurity/CodeSecurityRequestBuilder.cs index 9119054fc..2670912e6 100644 --- a/src/GitHub/Enterprises/Item/Copilot/Billing/BillingRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/CodeSecurity/CodeSecurityRequestBuilder.cs @@ -1,39 +1,39 @@ // #pragma warning disable CS0618 -using GitHub.Enterprises.Item.Copilot.Billing.Seats; +using GitHub.Enterprises.Item.CodeSecurity.Configurations; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using System; -namespace GitHub.Enterprises.Item.Copilot.Billing +namespace GitHub.Enterprises.Item.CodeSecurity { /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class BillingRequestBuilder : BaseRequestBuilder + public partial class CodeSecurityRequestBuilder : BaseRequestBuilder { - /// The seats property - public global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsRequestBuilder Seats + /// The configurations property + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsRequestBuilder Configurations { - get => new global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsRequestBuilder(PathParameters, RequestAdapter); + get => new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. - public BillingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing", pathParameters) + public CodeSecurityRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security", pathParameters) { } /// - /// Instantiates a new and sets the default values. + /// 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 BillingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing", rawUrl) + public CodeSecurityRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security", rawUrl) { } } diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs new file mode 100644 index 000000000..b29dac1b8 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody.cs @@ -0,0 +1,152 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ConfigurationsPostRequestBody : IParsable + #pragma warning restore CS1591 + { + /// The enablement status of GitHub Advanced Security + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_advanced_security? AdvancedSecurity { get; set; } + /// The enablement status of code scanning default setup + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_code_scanning_default_setup? CodeScanningDefaultSetup { get; set; } + /// Feature options for code scanning default setup +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.CodeScanningDefaultSetupOptions? CodeScanningDefaultSetupOptions { get; set; } +#nullable restore +#else + public global::GitHub.Models.CodeScanningDefaultSetupOptions CodeScanningDefaultSetupOptions { get; set; } +#endif + /// The enablement status of Dependabot alerts + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependabot_alerts? DependabotAlerts { get; set; } + /// The enablement status of Dependabot security updates + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependabot_security_updates? DependabotSecurityUpdates { get; set; } + /// The enablement status of Dependency Graph + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph? DependencyGraph { get; set; } + /// The enablement status of Automatic dependency submission + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options? DependencyGraphAutosubmitActionOptions { get; set; } +#nullable restore +#else + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.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 + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The enforcement status for a security configuration + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_enforcement? Enforcement { get; set; } + /// The name of the code security configuration. Must be unique within the enterprise. +#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 enablement status of private vulnerability reporting + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_private_vulnerability_reporting? PrivateVulnerabilityReporting { get; set; } + /// The enablement status of secret scanning + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning? SecretScanning { get; set; } + /// The enablement status of secret scanning non provider patterns + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns? SecretScanningNonProviderPatterns { get; set; } + /// The enablement status of secret scanning push protection + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_push_protection? SecretScanningPushProtection { get; set; } + /// The enablement status of secret scanning validity checks + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_validity_checks? SecretScanningValidityChecks { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ConfigurationsPostRequestBody() + { + AdvancedSecurity = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_advanced_security.Disabled; + CodeScanningDefaultSetup = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_code_scanning_default_setup.Disabled; + DependabotAlerts = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependabot_alerts.Disabled; + DependabotSecurityUpdates = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependabot_security_updates.Disabled; + DependencyGraph = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph.Enabled; + DependencyGraphAutosubmitAction = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.Disabled; + Enforcement = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_enforcement.Enforced; + PrivateVulnerabilityReporting = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_private_vulnerability_reporting.Disabled; + SecretScanning = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning.Disabled; + SecretScanningNonProviderPatterns = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns.Disabled; + SecretScanningPushProtection = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_push_protection.Disabled; + SecretScanningValidityChecks = global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_secret_scanning_validity_checks.Disabled; + } + /// + /// 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "advanced_security", n => { AdvancedSecurity = n.GetEnumValue(); } }, + { "code_scanning_default_setup", n => { CodeScanningDefaultSetup = n.GetEnumValue(); } }, + { "code_scanning_default_setup_options", n => { CodeScanningDefaultSetupOptions = n.GetObjectValue(global::GitHub.Models.CodeScanningDefaultSetupOptions.CreateFromDiscriminatorValue); } }, + { "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(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.CreateFromDiscriminatorValue); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "enforcement", n => { Enforcement = n.GetEnumValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "private_vulnerability_reporting", n => { PrivateVulnerabilityReporting = n.GetEnumValue(); } }, + { "secret_scanning", n => { SecretScanning = n.GetEnumValue(); } }, + { "secret_scanning_non_provider_patterns", n => { SecretScanningNonProviderPatterns = n.GetEnumValue(); } }, + { "secret_scanning_push_protection", n => { SecretScanningPushProtection = n.GetEnumValue(); } }, + { "secret_scanning_validity_checks", n => { SecretScanningValidityChecks = 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.WriteEnumValue("advanced_security", AdvancedSecurity); + writer.WriteEnumValue("code_scanning_default_setup", CodeScanningDefaultSetup); + writer.WriteObjectValue("code_scanning_default_setup_options", CodeScanningDefaultSetupOptions); + 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); + writer.WriteEnumValue("private_vulnerability_reporting", PrivateVulnerabilityReporting); + writer.WriteEnumValue("secret_scanning", SecretScanning); + writer.WriteEnumValue("secret_scanning_non_provider_patterns", SecretScanningNonProviderPatterns); + writer.WriteEnumValue("secret_scanning_push_protection", SecretScanningPushProtection); + writer.WriteEnumValue("secret_scanning_validity_checks", SecretScanningValidityChecks); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_advanced_security.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_advanced_security.cs new file mode 100644 index 000000000..6809bd96d --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_advanced_security.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of GitHub Advanced Security + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_advanced_security + { + [EnumMember(Value = "enabled")] + #pragma warning disable CS1591 + Enabled, + #pragma warning restore CS1591 + [EnumMember(Value = "disabled")] + #pragma warning disable CS1591 + Disabled, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_code_scanning_default_setup.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_code_scanning_default_setup.cs new file mode 100644 index 000000000..b31a4fc4c --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_code_scanning_default_setup.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of code scanning default setup + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_code_scanning_default_setup + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_alerts.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_alerts.cs new file mode 100644 index 000000000..3e13dea5f --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_alerts.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of Dependabot alerts + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_dependabot_alerts + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_security_updates.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_security_updates.cs new file mode 100644 index 000000000..7a8d12202 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependabot_security_updates.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of Dependabot security updates + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_dependabot_security_updates + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph.cs new file mode 100644 index 000000000..825fbeb13 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of Dependency Graph + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_dependency_graph + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs new file mode 100644 index 000000000..b9cac4fc5 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of Automatic dependency submission + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + 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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs new file mode 100644 index 000000000..a84a47353 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// + /// Feature options for Automatic dependency submission + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.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); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_enforcement.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_enforcement.cs new file mode 100644 index 000000000..9f70df0f5 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_enforcement.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enforcement status for a security configuration + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_enforcement + { + [EnumMember(Value = "enforced")] + #pragma warning disable CS1591 + Enforced, + #pragma warning restore CS1591 + [EnumMember(Value = "unenforced")] + #pragma warning disable CS1591 + Unenforced, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_private_vulnerability_reporting.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_private_vulnerability_reporting.cs new file mode 100644 index 000000000..cb924ddd4 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_private_vulnerability_reporting.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of private vulnerability reporting + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_private_vulnerability_reporting + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning.cs new file mode 100644 index 000000000..3202d0d30 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of secret scanning + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_secret_scanning + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns.cs new file mode 100644 index 000000000..7744059f1 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of secret scanning non provider patterns + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_push_protection.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_push_protection.cs new file mode 100644 index 000000000..9baea857e --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_push_protection.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of secret scanning push protection + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_secret_scanning_push_protection + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_validity_checks.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_validity_checks.cs new file mode 100644 index 000000000..6ecb1f76e --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsPostRequestBody_secret_scanning_validity_checks.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// The enablement status of secret scanning validity checks + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum ConfigurationsPostRequestBody_secret_scanning_validity_checks + { + [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/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsRequestBuilder.cs new file mode 100644 index 000000000..c86fe4928 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/ConfigurationsRequestBuilder.cs @@ -0,0 +1,194 @@ +// +#pragma warning disable CS0618 +using GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults; +using GitHub.Enterprises.Item.CodeSecurity.Configurations.Item; +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class ConfigurationsRequestBuilder : BaseRequestBuilder + { + /// The defaults property + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults.DefaultsRequestBuilder Defaults + { + get => new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults.DefaultsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the GitHub.enterprises.item.codeSecurity.configurations.item collection + /// The unique identifier of the code security configuration. + /// A + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("configuration_id", position); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_ItemRequestBuilder(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 ConfigurationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations{?after*,before*,per_page*}", 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 ConfigurationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations{?after*,before*,per_page*}", rawUrl) + { + } + /// + /// Lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// API method documentation + /// + /// A List<global::GitHub.Models.CodeSecurityConfiguration> + /// 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) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CodeSecurityConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// + /// Creates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 400 status code + /// 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 PostAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeSecurityConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope 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; + } + /// + /// Creates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsPostRequestBody 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.ConfigurationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class ConfigurationsRequestBuilderGetQueryParameters + { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Defaults/DefaultsRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Defaults/DefaultsRequestBuilder.cs new file mode 100644 index 000000000..824bc822e --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Defaults/DefaultsRequestBuilder.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\defaults + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class DefaultsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/defaults", 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 DefaultsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/defaults", rawUrl) + { + } + /// + /// Lists the default code security configurations for an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// API method documentation + /// + /// A List<global::GitHub.Models.CodeSecurityDefaultConfigurations> + /// 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 +#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 collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CodeSecurityDefaultConfigurations.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// + /// Lists the default code security configurations for an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults.DefaultsRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Defaults.DefaultsRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody.cs new file mode 100644 index 000000000..a4f6525c7 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody.cs @@ -0,0 +1,49 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class AttachPostRequestBody : IParsable + #pragma warning restore CS1591 + { + /// The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody_scope? Scope { get; set; } + /// + /// 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "scope", n => { Scope = 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.WriteEnumValue("scope", Scope); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody_scope.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody_scope.cs new file mode 100644 index 000000000..086300454 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostRequestBody_scope.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach +{ + /// The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum AttachPostRequestBody_scope + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "all_without_configurations")] + #pragma warning disable CS1591 + All_without_configurations, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostResponse.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostResponse.cs new file mode 100644 index 000000000..e0f2b0471 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachPostResponse.cs @@ -0,0 +1,55 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class AttachPostResponse : 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; } + /// + /// Instantiates a new and sets the default values. + /// + public AttachPostResponse() + { + 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostResponse(); + } + /// + /// 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); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachRequestBuilder.cs new file mode 100644 index 000000000..bec7a53da --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Attach/AttachRequestBuilder.cs @@ -0,0 +1,99 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\attach + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class AttachRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AttachRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach", 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 AttachRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach", rawUrl) + { + } + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "409", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachPostRequestBody 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody.cs new file mode 100644 index 000000000..765ce6d09 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody.cs @@ -0,0 +1,59 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class DefaultsPutRequestBody : 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; } + /// Specify which types of repository this security configuration should be applied to by default. + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody_default_for_new_repos? DefaultForNewRepos { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public DefaultsPutRequestBody() + { + 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "default_for_new_repos", n => { DefaultForNewRepos = 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.WriteEnumValue("default_for_new_repos", DefaultForNewRepos); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody_default_for_new_repos.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody_default_for_new_repos.cs new file mode 100644 index 000000000..17c5abe8a --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutRequestBody_default_for_new_repos.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults +{ + /// Specify which types of repository this security configuration should be applied to by default. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum DefaultsPutRequestBody_default_for_new_repos + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + [EnumMember(Value = "private_and_internal")] + #pragma warning disable CS1591 + Private_and_internal, + #pragma warning restore CS1591 + [EnumMember(Value = "public")] + #pragma warning disable CS1591 + Public, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse.cs new file mode 100644 index 000000000..4e2e500e1 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class DefaultsPutResponse : 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; } + /// A code security configuration +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.CodeSecurityConfiguration? Configuration { get; set; } +#nullable restore +#else + public global::GitHub.Models.CodeSecurityConfiguration Configuration { get; set; } +#endif + /// Specifies which types of repository this security configuration is applied to by default. + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutResponse_default_for_new_repos? DefaultForNewRepos { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public DefaultsPutResponse() + { + 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "configuration", n => { Configuration = n.GetObjectValue(global::GitHub.Models.CodeSecurityConfiguration.CreateFromDiscriminatorValue); } }, + { "default_for_new_repos", n => { DefaultForNewRepos = 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.WriteObjectValue("configuration", Configuration); + writer.WriteEnumValue("default_for_new_repos", DefaultForNewRepos); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse_default_for_new_repos.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse_default_for_new_repos.cs new file mode 100644 index 000000000..fb661cfcf --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsPutResponse_default_for_new_repos.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults +{ + /// Specifies which types of repository this security configuration is applied to by default. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum DefaultsPutResponse_default_for_new_repos + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "none")] + #pragma warning disable CS1591 + None, + #pragma warning restore CS1591 + [EnumMember(Value = "private_and_internal")] + #pragma warning disable CS1591 + Private_and_internal, + #pragma warning restore CS1591 + [EnumMember(Value = "public")] + #pragma warning disable CS1591 + Public, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsRequestBuilder.cs new file mode 100644 index 000000000..1647de6bc --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Defaults/DefaultsRequestBuilder.cs @@ -0,0 +1,97 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\defaults + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class DefaultsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults", 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 DefaultsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults", rawUrl) + { + } + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise.This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 403 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise.This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 ToPutRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Repositories/RepositoriesRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Repositories/RepositoriesRequestBuilder.cs new file mode 100644 index 000000000..9ef0b28e5 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/Repositories/RepositoriesRequestBuilder.cs @@ -0,0 +1,133 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\repositories + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RepositoriesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RepositoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories{?after*,before*,per_page*,status*}", 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 RepositoriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories{?after*,before*,per_page*,status*}", rawUrl) + { + } + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// API method documentation + /// + /// A List<global::GitHub.Models.CodeSecurityConfigurationRepositories> + /// 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) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CodeSecurityConfigurationRepositories.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories.RepositoriesRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories.RepositoriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RepositoriesRequestBuilderGetQueryParameters + { + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("per_page")] + public int? PerPage { get; set; } + /// A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.Can be: `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("status")] + public string? Status { get; set; } +#nullable restore +#else + [QueryParameter("status")] + public string Status { get; set; } +#endif + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_ItemRequestBuilder.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_ItemRequestBuilder.cs new file mode 100644 index 000000000..c20521ec3 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_ItemRequestBuilder.cs @@ -0,0 +1,210 @@ +// +#pragma warning disable CS0618 +using GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach; +using GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults; +using GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories; +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// + /// Builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class WithConfiguration_ItemRequestBuilder : BaseRequestBuilder + { + /// The attach property + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachRequestBuilder Attach + { + get => new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Attach.AttachRequestBuilder(PathParameters, RequestAdapter); + } + /// The defaults property + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsRequestBuilder Defaults + { + get => new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Defaults.DefaultsRequestBuilder(PathParameters, RequestAdapter); + } + /// The repositories property + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories.RepositoriesRequestBuilder Repositories + { + get => new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.Repositories.RepositoriesRequestBuilder(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 WithConfiguration_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}", 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 WithConfiguration_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}", rawUrl) + { + } + /// + /// Deletes a code security configuration from an enterprise.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// API method documentation + /// + /// Cancellation token to use when cancelling requests + /// 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 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "409", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a code security configuration available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// API method documentation + /// + /// 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) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeSecurityConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "409", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeSecurityConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a code security configuration from an enterprise.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope 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 ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json"); + return requestInfo; + } + /// + /// Gets a code security configuration available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope 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; + } + /// + /// Updates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` 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 ToPatchRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_ItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs new file mode 100644 index 000000000..44621a5ab --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody.cs @@ -0,0 +1,134 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class WithConfiguration_PatchRequestBody : IParsable + #pragma warning restore CS1591 + { + /// The enablement status of GitHub Advanced Security. Must be set to enabled if you want to enable any GHAS settings. + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_advanced_security? AdvancedSecurity { get; set; } + /// The enablement status of code scanning default setup + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_code_scanning_default_setup? CodeScanningDefaultSetup { get; set; } + /// Feature options for code scanning default setup +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.CodeScanningDefaultSetupOptions? CodeScanningDefaultSetupOptions { get; set; } +#nullable restore +#else + public global::GitHub.Models.CodeScanningDefaultSetupOptions CodeScanningDefaultSetupOptions { get; set; } +#endif + /// The enablement status of Dependabot alerts + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependabot_alerts? DependabotAlerts { get; set; } + /// The enablement status of Dependabot security updates + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependabot_security_updates? DependabotSecurityUpdates { get; set; } + /// The enablement status of Dependency Graph + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependency_graph? DependencyGraph { get; set; } + /// The enablement status of Automatic dependency submission + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options? DependencyGraphAutosubmitActionOptions { get; set; } +#nullable restore +#else + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.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 + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The enforcement status for a security configuration + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_enforcement? Enforcement { get; set; } + /// The name of the code security configuration. Must be unique across the enterprise. +#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 enablement status of private vulnerability reporting + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_private_vulnerability_reporting? PrivateVulnerabilityReporting { get; set; } + /// The enablement status of secret scanning + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_secret_scanning? SecretScanning { get; set; } + /// The enablement status of secret scanning non-provider patterns + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns? SecretScanningNonProviderPatterns { get; set; } + /// The enablement status of secret scanning push protection + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_secret_scanning_push_protection? SecretScanningPushProtection { get; set; } + /// The enablement status of secret scanning validity checks + public global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_secret_scanning_validity_checks? SecretScanningValidityChecks { get; set; } + /// + /// 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "advanced_security", n => { AdvancedSecurity = n.GetEnumValue(); } }, + { "code_scanning_default_setup", n => { CodeScanningDefaultSetup = n.GetEnumValue(); } }, + { "code_scanning_default_setup_options", n => { CodeScanningDefaultSetupOptions = n.GetObjectValue(global::GitHub.Models.CodeScanningDefaultSetupOptions.CreateFromDiscriminatorValue); } }, + { "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(global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.CreateFromDiscriminatorValue); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "enforcement", n => { Enforcement = n.GetEnumValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "private_vulnerability_reporting", n => { PrivateVulnerabilityReporting = n.GetEnumValue(); } }, + { "secret_scanning", n => { SecretScanning = n.GetEnumValue(); } }, + { "secret_scanning_non_provider_patterns", n => { SecretScanningNonProviderPatterns = n.GetEnumValue(); } }, + { "secret_scanning_push_protection", n => { SecretScanningPushProtection = n.GetEnumValue(); } }, + { "secret_scanning_validity_checks", n => { SecretScanningValidityChecks = 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.WriteEnumValue("advanced_security", AdvancedSecurity); + writer.WriteEnumValue("code_scanning_default_setup", CodeScanningDefaultSetup); + writer.WriteObjectValue("code_scanning_default_setup_options", CodeScanningDefaultSetupOptions); + 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); + writer.WriteEnumValue("private_vulnerability_reporting", PrivateVulnerabilityReporting); + writer.WriteEnumValue("secret_scanning", SecretScanning); + writer.WriteEnumValue("secret_scanning_non_provider_patterns", SecretScanningNonProviderPatterns); + writer.WriteEnumValue("secret_scanning_push_protection", SecretScanningPushProtection); + writer.WriteEnumValue("secret_scanning_validity_checks", SecretScanningValidityChecks); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_advanced_security.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_advanced_security.cs new file mode 100644 index 000000000..e79ae52fe --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_advanced_security.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of GitHub Advanced Security. Must be set to enabled if you want to enable any GHAS settings. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_advanced_security + { + [EnumMember(Value = "enabled")] + #pragma warning disable CS1591 + Enabled, + #pragma warning restore CS1591 + [EnumMember(Value = "disabled")] + #pragma warning disable CS1591 + Disabled, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_code_scanning_default_setup.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_code_scanning_default_setup.cs new file mode 100644 index 000000000..3eb984bbd --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_code_scanning_default_setup.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of code scanning default setup + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_code_scanning_default_setup + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_alerts.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_alerts.cs new file mode 100644 index 000000000..c9d9e2caf --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_alerts.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of Dependabot alerts + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_dependabot_alerts + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_security_updates.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_security_updates.cs new file mode 100644 index 000000000..60463fd17 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependabot_security_updates.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of Dependabot security updates + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_dependabot_security_updates + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph.cs new file mode 100644 index 000000000..28545c5dd --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of Dependency Graph + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_dependency_graph + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs new file mode 100644 index 000000000..3ab4e8d2e --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of Automatic dependency submission + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + 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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs new file mode 100644 index 000000000..8528463d9 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// + /// Feature options for Automatic dependency submission + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial 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 global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Enterprises.Item.CodeSecurity.Configurations.Item.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); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_enforcement.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_enforcement.cs new file mode 100644 index 000000000..fc8fd8ad8 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_enforcement.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enforcement status for a security configuration + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_enforcement + { + [EnumMember(Value = "enforced")] + #pragma warning disable CS1591 + Enforced, + #pragma warning restore CS1591 + [EnumMember(Value = "unenforced")] + #pragma warning disable CS1591 + Unenforced, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_private_vulnerability_reporting.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_private_vulnerability_reporting.cs new file mode 100644 index 000000000..2e844d525 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_private_vulnerability_reporting.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of private vulnerability reporting + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_private_vulnerability_reporting + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning.cs new file mode 100644 index 000000000..7e2f67dcd --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of secret scanning + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_secret_scanning + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns.cs new file mode 100644 index 000000000..977cdf153 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of secret scanning non-provider patterns + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_push_protection.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_push_protection.cs new file mode 100644 index 000000000..8155ccb0a --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_push_protection.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of secret scanning push protection + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_secret_scanning_push_protection + { + [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/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_validity_checks.cs b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_validity_checks.cs new file mode 100644 index 000000000..8b3a48465 --- /dev/null +++ b/src/GitHub/Enterprises/Item/CodeSecurity/Configurations/Item/WithConfiguration_PatchRequestBody_secret_scanning_validity_checks.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Enterprises.Item.CodeSecurity.Configurations.Item +{ + /// The enablement status of secret scanning validity checks + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithConfiguration_PatchRequestBody_secret_scanning_validity_checks + { + [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/Enterprises/Item/Copilot/Billing/Seats/SeatsRequestBuilder.cs b/src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsRequestBuilder.cs deleted file mode 100644 index ce4e254a4..000000000 --- a/src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsRequestBuilder.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Models; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace GitHub.Enterprises.Item.Copilot.Billing.Seats -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing\seats - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class SeatsRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public SeatsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing/seats{?page*,per_page*}", 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 SeatsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing/seats{?page*,per_page*}", rawUrl) - { - } - /// - /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. - /// API method documentation - /// - /// A - /// 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", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - }; - return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); - } - /// - /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.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 global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsRequestBuilder WithUrl(string rawUrl) - { - return new global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class SeatsRequestBuilderGetQueryParameters - { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - [QueryParameter("page")] - public int? Page { get; set; } - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - [QueryParameter("per_page")] - public int? PerPage { get; set; } - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Copilot/CopilotRequestBuilder.cs b/src/GitHub/Enterprises/Item/Copilot/CopilotRequestBuilder.cs deleted file mode 100644 index 7dcc5601c..000000000 --- a/src/GitHub/Enterprises/Item/Copilot/CopilotRequestBuilder.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Enterprises.Item.Copilot.Billing; -using GitHub.Enterprises.Item.Copilot.Metrics; -using GitHub.Enterprises.Item.Copilot.Usage; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System; -namespace GitHub.Enterprises.Item.Copilot -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\copilot - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class CopilotRequestBuilder : BaseRequestBuilder - { - /// The billing property - public global::GitHub.Enterprises.Item.Copilot.Billing.BillingRequestBuilder Billing - { - get => new global::GitHub.Enterprises.Item.Copilot.Billing.BillingRequestBuilder(PathParameters, RequestAdapter); - } - /// The metrics property - public global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder Metrics - { - get => new global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); - } - /// The usage property - public global::GitHub.Enterprises.Item.Copilot.Usage.UsageRequestBuilder Usage - { - get => new global::GitHub.Enterprises.Item.Copilot.Usage.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}/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}/copilot", rawUrl) - { - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Copilot/Metrics/MetricsRequestBuilder.cs b/src/GitHub/Enterprises/Item/Copilot/Metrics/MetricsRequestBuilder.cs deleted file mode 100644 index 566b54938..000000000 --- a/src/GitHub/Enterprises/Item/Copilot/Metrics/MetricsRequestBuilder.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Models; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace GitHub.Enterprises.Item.Copilot.Metrics -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\copilot\metrics - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class MetricsRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?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 MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?page*,per_page*,since*,until*}", rawUrl) - { - } - /// - /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. - /// API method documentation - /// - /// A List<global::GitHub.Models.CopilotUsageMetricsDay> - /// 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 - /// When receiving a 422 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> - { - { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "422", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - }; - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CopilotUsageMetricsDay.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); - return collectionResult?.AsList(); - } - /// - /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. - /// - /// 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 global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder WithUrl(string rawUrl) - { - return new global::GitHub.Enterprises.Item.Copilot.Metrics.MetricsRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class MetricsRequestBuilderGetQueryParameters - { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/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/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 - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs deleted file mode 100644 index 2530b41c0..000000000 --- a/src/GitHub/Enterprises/Item/Copilot/Usage/UsageRequestBuilder.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Models; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace GitHub.Enterprises.Item.Copilot.Usage -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\copilot\usage - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial 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}/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}/copilot/usage{?page*,per_page*,since*,until*}", rawUrl) - { - } - /// - /// > [!NOTE]> This endpoint is in public preview 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.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<global::GitHub.Models.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", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - }; - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CopilotUsageMetrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); - return collectionResult?.AsList(); - } - /// - /// > [!NOTE]> This endpoint is in public preview 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.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. -#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 global::GitHub.Enterprises.Item.Copilot.Usage.UsageRequestBuilder WithUrl(string rawUrl) - { - return new global::GitHub.Enterprises.Item.Copilot.Usage.UsageRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// > [!NOTE]> This endpoint is in public preview 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.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. - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class UsageRequestBuilderGetQueryParameters - { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/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/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 - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs b/src/GitHub/Enterprises/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs index 24376e0d9..ef1861c04 100644 --- a/src/GitHub/Enterprises/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs @@ -136,7 +136,7 @@ public partial class AlertsRequestBuilderGetQueryParameters [QueryParameter("resolution")] public string Resolution { get; set; } #endif - /// A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable [QueryParameter("secret_type")] diff --git a/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs deleted file mode 100644 index 56b1f4e7f..000000000 --- a/src/GitHub/Enterprises/Item/Team/Item/Copilot/CopilotRequestBuilder.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Enterprises.Item.Team.Item.Copilot.Metrics; -using GitHub.Enterprises.Item.Team.Item.Copilot.Usage; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -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 - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class CopilotRequestBuilder : BaseRequestBuilder - { - /// The metrics property - public global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder Metrics - { - get => new global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder(PathParameters, RequestAdapter); - } - /// The usage property - public global::GitHub.Enterprises.Item.Team.Item.Copilot.Usage.UsageRequestBuilder Usage - { - get => new global::GitHub.Enterprises.Item.Team.Item.Copilot.Usage.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) - { - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Team/Item/Copilot/Metrics/MetricsRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/Copilot/Metrics/MetricsRequestBuilder.cs deleted file mode 100644 index d6632f791..000000000 --- a/src/GitHub/Enterprises/Item/Team/Item/Copilot/Metrics/MetricsRequestBuilder.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Models; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace GitHub.Enterprises.Item.Team.Item.Copilot.Metrics -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot\metrics - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class MetricsRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public MetricsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/metrics{?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 MetricsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/metrics{?page*,per_page*,since*,until*}", rawUrl) - { - } - /// - /// > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot 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<global::GitHub.Models.CopilotUsageMetricsDay> - /// 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 - /// When receiving a 422 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> - { - { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "422", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - }; - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CopilotUsageMetricsDay.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); - return collectionResult?.AsList(); - } - /// - /// > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot 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 global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder WithUrl(string rawUrl) - { - return new global::GitHub.Enterprises.Item.Team.Item.Copilot.Metrics.MetricsRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.> [!NOTE]> This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot 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. - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class MetricsRequestBuilderGetQueryParameters - { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/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/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 - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs deleted file mode 100644 index 9f24f1973..000000000 --- a/src/GitHub/Enterprises/Item/Team/Item/Copilot/Usage/UsageRequestBuilder.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Models; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace GitHub.Enterprises.Item.Team.Item.Copilot.Usage -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot\usage - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial 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 public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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<global::GitHub.Models.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", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - { "500", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, - }; - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::GitHub.Models.CopilotUsageMetrics.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); - return collectionResult?.AsList(); - } - /// - /// > [!NOTE]> This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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 global::GitHub.Enterprises.Item.Team.Item.Copilot.Usage.UsageRequestBuilder WithUrl(string rawUrl) - { - return new global::GitHub.Enterprises.Item.Team.Item.Copilot.Usage.UsageRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// > [!NOTE]> This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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. - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class UsageRequestBuilderGetQueryParameters - { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/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/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 - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs deleted file mode 100644 index bfce36c8b..000000000 --- a/src/GitHub/Enterprises/Item/Team/Item/WithTeam_slugItemRequestBuilder.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Enterprises.Item.Team.Item.Copilot; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System; -namespace GitHub.Enterprises.Item.Team.Item -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug} - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class WithTeam_slugItemRequestBuilder : BaseRequestBuilder - { - /// The copilot property - public global::GitHub.Enterprises.Item.Team.Item.Copilot.CopilotRequestBuilder Copilot - { - get => new global::GitHub.Enterprises.Item.Team.Item.Copilot.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) - { - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs b/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs deleted file mode 100644 index 4ca34a335..000000000 --- a/src/GitHub/Enterprises/Item/Team/TeamRequestBuilder.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -#pragma warning disable CS0618 -using GitHub.Enterprises.Item.Team.Item; -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System; -namespace GitHub.Enterprises.Item.Team -{ - /// - /// Builds and executes requests for operations under \enterprises\{enterprise}\team - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class TeamRequestBuilder : BaseRequestBuilder - { - /// Gets an item from the GitHub.enterprises.item.team.item collection - /// The slug of the enterprise team name. - /// A - public global::GitHub.Enterprises.Item.Team.Item.WithTeam_slugItemRequestBuilder this[string position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - urlTplParams.Add("team_slug", position); - return new global::GitHub.Enterprises.Item.Team.Item.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) - { - } - } -} -#pragma warning restore CS0618 diff --git a/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs b/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs index 2ab1bdbe9..69a90de7b 100644 --- a/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs +++ b/src/GitHub/Enterprises/Item/WithEnterpriseItemRequestBuilder.cs @@ -1,9 +1,8 @@ // #pragma warning disable CS0618 -using GitHub.Enterprises.Item.Copilot; +using GitHub.Enterprises.Item.CodeSecurity; using GitHub.Enterprises.Item.Dependabot; using GitHub.Enterprises.Item.SecretScanning; -using GitHub.Enterprises.Item.Team; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; @@ -18,10 +17,10 @@ namespace GitHub.Enterprises.Item [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] public partial class WithEnterpriseItemRequestBuilder : BaseRequestBuilder { - /// The copilot property - public global::GitHub.Enterprises.Item.Copilot.CopilotRequestBuilder Copilot + /// The codeSecurity property + public global::GitHub.Enterprises.Item.CodeSecurity.CodeSecurityRequestBuilder CodeSecurity { - get => new global::GitHub.Enterprises.Item.Copilot.CopilotRequestBuilder(PathParameters, RequestAdapter); + get => new global::GitHub.Enterprises.Item.CodeSecurity.CodeSecurityRequestBuilder(PathParameters, RequestAdapter); } /// The dependabot property public global::GitHub.Enterprises.Item.Dependabot.DependabotRequestBuilder Dependabot @@ -33,11 +32,6 @@ public partial class WithEnterpriseItemRequestBuilder : BaseRequestBuilder { get => new global::GitHub.Enterprises.Item.SecretScanning.SecretScanningRequestBuilder(PathParameters, RequestAdapter); } - /// The team property - public global::GitHub.Enterprises.Item.Team.TeamRequestBuilder Team - { - get => new global::GitHub.Enterprises.Item.Team.TeamRequestBuilder(PathParameters, RequestAdapter); - } /// /// Instantiates a new and sets the default values. /// diff --git a/src/GitHub/Models/ApiOverview_domains.cs b/src/GitHub/Models/ApiOverview_domains.cs index 51f15c836..01c7e3d32 100644 --- a/src/GitHub/Models/ApiOverview_domains.cs +++ b/src/GitHub/Models/ApiOverview_domains.cs @@ -19,6 +19,14 @@ public partial class ApiOverview_domains : IAdditionalDataHolder, IParsable #nullable restore #else public List Actions { get; set; } +#endif + /// The actions_inbound property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.ApiOverview_domains_actions_inbound? ActionsInbound { get; set; } +#nullable restore +#else + public global::GitHub.Models.ApiOverview_domains_actions_inbound ActionsInbound { get; set; } #endif /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } @@ -88,6 +96,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "actions", n => { Actions = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "actions_inbound", n => { ActionsInbound = n.GetObjectValue(global::GitHub.Models.ApiOverview_domains_actions_inbound.CreateFromDiscriminatorValue); } }, { "artifact_attestations", n => { ArtifactAttestations = n.GetObjectValue(global::GitHub.Models.ApiOverview_domains_artifact_attestations.CreateFromDiscriminatorValue); } }, { "codespaces", n => { Codespaces = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, { "copilot", n => { Copilot = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, @@ -103,6 +112,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfPrimitiveValues("actions", Actions); + writer.WriteObjectValue("actions_inbound", ActionsInbound); writer.WriteObjectValue("artifact_attestations", ArtifactAttestations); writer.WriteCollectionOfPrimitiveValues("codespaces", Codespaces); writer.WriteCollectionOfPrimitiveValues("copilot", Copilot); diff --git a/src/GitHub/Models/ApiOverview_domains_actions_inbound.cs b/src/GitHub/Models/ApiOverview_domains_actions_inbound.cs new file mode 100644 index 000000000..048a510ba --- /dev/null +++ b/src/GitHub/Models/ApiOverview_domains_actions_inbound.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class ApiOverview_domains_actions_inbound : 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 full_domains property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FullDomains { get; set; } +#nullable restore +#else + public List FullDomains { get; set; } +#endif + /// The wildcard_domains property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? WildcardDomains { get; set; } +#nullable restore +#else + public List WildcardDomains { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApiOverview_domains_actions_inbound() + { + 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 global::GitHub.Models.ApiOverview_domains_actions_inbound CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.ApiOverview_domains_actions_inbound(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "full_domains", n => { FullDomains = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "wildcard_domains", n => { WildcardDomains = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + }; + } + /// + /// 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("full_domains", FullDomains); + writer.WriteCollectionOfPrimitiveValues("wildcard_domains", WildcardDomains); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofix.cs b/src/GitHub/Models/CodeScanningAutofix.cs new file mode 100644 index 000000000..927432f4c --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofix.cs @@ -0,0 +1,72 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class CodeScanningAutofix : 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 description of an autofix. +#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 + /// The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + public DateTimeOffset? StartedAt { get; private set; } + /// The status of an autofix. + public global::GitHub.Models.CodeScanningAutofixStatus? Status { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CodeScanningAutofix() + { + 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 global::GitHub.Models.CodeScanningAutofix CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.CodeScanningAutofix(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "started_at", n => { StartedAt = n.GetDateTimeOffsetValue(); } }, + { "status", n => { Status = 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("description", Description); + writer.WriteEnumValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofix503Error.cs b/src/GitHub/Models/CodeScanningAutofix503Error.cs new file mode 100644 index 000000000..99ebbd1e7 --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofix503Error.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class CodeScanningAutofix503Error : 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 primary error message. + public override string Message { get => MessageEscaped ?? string.Empty; } + /// 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 CodeScanningAutofix503Error() + { + 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 global::GitHub.Models.CodeScanningAutofix503Error CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.CodeScanningAutofix503Error(); + } + /// + /// 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); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofixCommits.cs b/src/GitHub/Models/CodeScanningAutofixCommits.cs new file mode 100644 index 000000000..e016ee553 --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofixCommits.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + /// + /// Commit an autofix for a code scanning alert + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class CodeScanningAutofixCommits : 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; } + /// Commit message to be used. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TargetRef { get; set; } +#nullable restore +#else + public string TargetRef { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CodeScanningAutofixCommits() + { + 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 global::GitHub.Models.CodeScanningAutofixCommits CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.CodeScanningAutofixCommits(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "message", n => { Message = n.GetStringValue(); } }, + { "target_ref", n => { TargetRef = 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("message", Message); + writer.WriteStringValue("target_ref", TargetRef); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofixCommitsResponse.cs b/src/GitHub/Models/CodeScanningAutofixCommitsResponse.cs new file mode 100644 index 000000000..bfead7f3b --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofixCommitsResponse.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class CodeScanningAutofixCommitsResponse : 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; } + /// SHA of commit with autofix. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Sha { get; set; } +#nullable restore +#else + public string Sha { get; set; } +#endif + /// The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TargetRef { get; set; } +#nullable restore +#else + public string TargetRef { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CodeScanningAutofixCommitsResponse() + { + 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 global::GitHub.Models.CodeScanningAutofixCommitsResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.CodeScanningAutofixCommitsResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sha", n => { Sha = n.GetStringValue(); } }, + { "target_ref", n => { TargetRef = 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("sha", Sha); + writer.WriteStringValue("target_ref", TargetRef); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofixCommitsResponse503Error.cs b/src/GitHub/Models/CodeScanningAutofixCommitsResponse503Error.cs new file mode 100644 index 000000000..267cc09c9 --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofixCommitsResponse503Error.cs @@ -0,0 +1,88 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class CodeScanningAutofixCommitsResponse503Error : 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 primary error message. + public override string Message { get => MessageEscaped ?? string.Empty; } + /// 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 CodeScanningAutofixCommitsResponse503Error() + { + 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 global::GitHub.Models.CodeScanningAutofixCommitsResponse503Error CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.CodeScanningAutofixCommitsResponse503Error(); + } + /// + /// 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); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/CodeScanningAutofixStatus.cs b/src/GitHub/Models/CodeScanningAutofixStatus.cs new file mode 100644 index 000000000..9a86b2baf --- /dev/null +++ b/src/GitHub/Models/CodeScanningAutofixStatus.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + /// The status of an autofix. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum CodeScanningAutofixStatus + { + [EnumMember(Value = "pending")] + #pragma warning disable CS1591 + Pending, + #pragma warning restore CS1591 + [EnumMember(Value = "error")] + #pragma warning disable CS1591 + Error, + #pragma warning restore CS1591 + [EnumMember(Value = "success")] + #pragma warning disable CS1591 + Success, + #pragma warning restore CS1591 + [EnumMember(Value = "outdated")] + #pragma warning disable CS1591 + Outdated, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/CodeScanningDefaultSetupUpdate_languages.cs b/src/GitHub/Models/CodeScanningDefaultSetupUpdate_languages.cs index 08f484238..9d115c0f5 100644 --- a/src/GitHub/Models/CodeScanningDefaultSetupUpdate_languages.cs +++ b/src/GitHub/Models/CodeScanningDefaultSetupUpdate_languages.cs @@ -8,6 +8,10 @@ namespace GitHub.Models public enum CodeScanningDefaultSetupUpdate_languages #pragma warning restore CS1591 { + [EnumMember(Value = "actions")] + #pragma warning disable CS1591 + Actions, + #pragma warning restore CS1591 [EnumMember(Value = "c-cpp")] #pragma warning disable CS1591 CCpp, diff --git a/src/GitHub/Models/CodeScanningDefaultSetup_languages.cs b/src/GitHub/Models/CodeScanningDefaultSetup_languages.cs index 73a4c0e5a..3ed2a15d8 100644 --- a/src/GitHub/Models/CodeScanningDefaultSetup_languages.cs +++ b/src/GitHub/Models/CodeScanningDefaultSetup_languages.cs @@ -8,6 +8,10 @@ namespace GitHub.Models public enum CodeScanningDefaultSetup_languages #pragma warning restore CS1591 { + [EnumMember(Value = "actions")] + #pragma warning disable CS1591 + Actions, + #pragma warning restore CS1591 [EnumMember(Value = "c-cpp")] #pragma warning disable CS1591 CCpp, diff --git a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody.cs b/src/GitHub/Models/CustomPropertySetPayload.cs similarity index 62% rename from src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody.cs rename to src/GitHub/Models/CustomPropertySetPayload.cs index d7c3afc6c..59f2e7b79 100644 --- a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody.cs +++ b/src/GitHub/Models/CustomPropertySetPayload.cs @@ -5,12 +5,13 @@ using System.Collections.Generic; using System.IO; using System; -namespace GitHub.Orgs.Item.Properties.Schema.Item +namespace GitHub.Models { + /// + /// Custom property set payload + /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - #pragma warning disable CS1591 - public partial class WithCustom_property_namePutRequestBody : IAdditionalDataHolder, IParsable - #pragma warning restore CS1591 + public partial class CustomPropertySetPayload : 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; } @@ -25,10 +26,10 @@ public partial class WithCustom_property_namePutRequestBody : IAdditionalDataHol /// Default value of the property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody.WithCustom_property_namePutRequestBody_default_value? DefaultValue { get; set; } + public global::GitHub.Models.CustomPropertySetPayload.CustomPropertySetPayload_default_value? DefaultValue { get; set; } #nullable restore #else - public global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody.WithCustom_property_namePutRequestBody_default_value DefaultValue { get; set; } + public global::GitHub.Models.CustomPropertySetPayload.CustomPropertySetPayload_default_value DefaultValue { get; set; } #endif /// Short description of the property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -41,23 +42,23 @@ public partial class WithCustom_property_namePutRequestBody : IAdditionalDataHol /// Whether the property is required. public bool? Required { get; set; } /// The type of the value for the property - public global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody_value_type? ValueType { get; set; } + public global::GitHub.Models.CustomPropertySetPayload_value_type? ValueType { get; set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WithCustom_property_namePutRequestBody() + public CustomPropertySetPayload() { 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 global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + public static global::GitHub.Models.CustomPropertySetPayload CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody(); + return new global::GitHub.Models.CustomPropertySetPayload(); } /// /// The deserialization information for the current model @@ -68,10 +69,10 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "allowed_values", n => { AllowedValues = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, - { "default_value", n => { DefaultValue = n.GetObjectValue(global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody.WithCustom_property_namePutRequestBody_default_value.CreateFromDiscriminatorValue); } }, + { "default_value", n => { DefaultValue = n.GetObjectValue(global::GitHub.Models.CustomPropertySetPayload.CustomPropertySetPayload_default_value.CreateFromDiscriminatorValue); } }, { "description", n => { Description = n.GetStringValue(); } }, { "required", n => { Required = n.GetBoolValue(); } }, - { "value_type", n => { ValueType = n.GetEnumValue(); } }, + { "value_type", n => { ValueType = n.GetEnumValue(); } }, }; } /// @@ -82,47 +83,47 @@ 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.WriteBoolValue("required", Required); - writer.WriteEnumValue("value_type", ValueType); + writer.WriteEnumValue("value_type", ValueType); writer.WriteAdditionalData(AdditionalData); } /// /// Composed type wrapper for classes , List<string> /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public partial class WithCustom_property_namePutRequestBody_default_value : IComposedTypeWrapper, IParsable + public partial class CustomPropertySetPayload_default_value : IComposedTypeWrapper, IParsable { - /// Composed type representation for type List<string> + /// Composed type representation for type #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? String { get; set; } + public string? CustomPropertySetPayloadDefaultValueString { get; set; } #nullable restore #else - public List String { get; set; } + public string CustomPropertySetPayloadDefaultValueString { get; set; } #endif - /// Composed type representation for type + /// Composed type representation for type List<string> #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? WithCustomPropertyNamePutRequestBodyDefaultValueString { get; set; } + public List? String { get; set; } #nullable restore #else - public string WithCustomPropertyNamePutRequestBodyDefaultValueString { get; set; } + public List String { get; set; } #endif /// /// 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 global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody.WithCustom_property_namePutRequestBody_default_value CreateFromDiscriminatorValue(IParseNode parseNode) + public static global::GitHub.Models.CustomPropertySetPayload.CustomPropertySetPayload_default_value CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody.WithCustom_property_namePutRequestBody_default_value(); - if(parseNode.GetStringValue() is string withCustomPropertyNamePutRequestBodyDefaultValueStringValue) + var result = new global::GitHub.Models.CustomPropertySetPayload.CustomPropertySetPayload_default_value(); + if(parseNode.GetStringValue() is string customPropertySetPayloadDefaultValueStringValue) { - result.WithCustomPropertyNamePutRequestBodyDefaultValueString = withCustomPropertyNamePutRequestBodyDefaultValueStringValue; + result.CustomPropertySetPayloadDefaultValueString = customPropertySetPayloadDefaultValueStringValue; } else if(parseNode.GetCollectionOfPrimitiveValues()?.AsList() is List stringValue) { @@ -145,9 +146,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - if(WithCustomPropertyNamePutRequestBodyDefaultValueString != null) + if(CustomPropertySetPayloadDefaultValueString != null) { - writer.WriteStringValue(null, WithCustomPropertyNamePutRequestBodyDefaultValueString); + writer.WriteStringValue(null, CustomPropertySetPayloadDefaultValueString); } else if(String != null) { diff --git a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody_value_type.cs b/src/GitHub/Models/CustomPropertySetPayload_value_type.cs similarity index 87% rename from src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody_value_type.cs rename to src/GitHub/Models/CustomPropertySetPayload_value_type.cs index 8d43c3c00..fea35ed50 100644 --- a/src/GitHub/Orgs/Item/Properties/Schema/Item/WithCustom_property_namePutRequestBody_value_type.cs +++ b/src/GitHub/Models/CustomPropertySetPayload_value_type.cs @@ -1,11 +1,11 @@ // using System.Runtime.Serialization; using System; -namespace GitHub.Orgs.Item.Properties.Schema.Item +namespace GitHub.Models { /// The type of the value for the property [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] - public enum WithCustom_property_namePutRequestBody_value_type + public enum CustomPropertySetPayload_value_type { [EnumMember(Value = "string")] #pragma warning disable CS1591 diff --git a/src/GitHub/Models/OrgPrivateRegistryConfiguration.cs b/src/GitHub/Models/OrgPrivateRegistryConfiguration.cs new file mode 100644 index 000000000..5f52ddfd6 --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfiguration.cs @@ -0,0 +1,92 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + /// + /// Private registry configuration for an organization + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class OrgPrivateRegistryConfiguration : 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 created_at property + public DateTimeOffset? CreatedAt { get; set; } + /// The name of the private registry configuration. +#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 registry type. + public global::GitHub.Models.OrgPrivateRegistryConfiguration_registry_type? RegistryType { get; set; } + /// The updated_at property + public DateTimeOffset? UpdatedAt { get; set; } + /// The username to use when authenticating with the private registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// Which type of organization repositories have access to the private registry. + public global::GitHub.Models.OrgPrivateRegistryConfiguration_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public OrgPrivateRegistryConfiguration() + { + 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 global::GitHub.Models.OrgPrivateRegistryConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.OrgPrivateRegistryConfiguration(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "registry_type", n => { RegistryType = n.GetEnumValue(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + { "visibility", n => { Visibility = 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.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("registry_type", RegistryType); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteStringValue("username", Username); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories.cs b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories.cs new file mode 100644 index 000000000..4e8e8e54d --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories.cs @@ -0,0 +1,102 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Models +{ + /// + /// Private registry configuration for an organization + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class OrgPrivateRegistryConfigurationWithSelectedRepositories : 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 created_at property + public DateTimeOffset? CreatedAt { get; set; } + /// The name of the private registry configuration. +#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 registry type. + public global::GitHub.Models.OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type? RegistryType { get; set; } + /// An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedRepositoryIds { get; set; } +#nullable restore +#else + public List SelectedRepositoryIds { get; set; } +#endif + /// The updated_at property + public DateTimeOffset? UpdatedAt { get; set; } + /// The username to use when authenticating with the private registry. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + public global::GitHub.Models.OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public OrgPrivateRegistryConfigurationWithSelectedRepositories() + { + 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 global::GitHub.Models.OrgPrivateRegistryConfigurationWithSelectedRepositories CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.OrgPrivateRegistryConfigurationWithSelectedRepositories(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "registry_type", n => { RegistryType = n.GetEnumValue(); } }, + { "selected_repository_ids", n => { SelectedRepositoryIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + { "visibility", n => { Visibility = 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.WriteDateTimeOffsetValue("created_at", CreatedAt); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("registry_type", RegistryType); + writer.WriteCollectionOfPrimitiveValues("selected_repository_ids", SelectedRepositoryIds); + writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt); + writer.WriteStringValue("username", Username); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type.cs b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type.cs new file mode 100644 index 000000000..1bf441c7d --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + /// The registry type. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type + { + [EnumMember(Value = "maven_repository")] + #pragma warning disable CS1591 + Maven_repository, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility.cs b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility.cs new file mode 100644 index 000000000..8d182c871 --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/OrgPrivateRegistryConfiguration_registry_type.cs b/src/GitHub/Models/OrgPrivateRegistryConfiguration_registry_type.cs new file mode 100644 index 000000000..068314a0a --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfiguration_registry_type.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + /// The registry type. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum OrgPrivateRegistryConfiguration_registry_type + { + [EnumMember(Value = "maven_repository")] + #pragma warning disable CS1591 + Maven_repository, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/OrgPrivateRegistryConfiguration_visibility.cs b/src/GitHub/Models/OrgPrivateRegistryConfiguration_visibility.cs new file mode 100644 index 000000000..6e3c7e6a1 --- /dev/null +++ b/src/GitHub/Models/OrgPrivateRegistryConfiguration_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + /// Which type of organization repositories have access to the private registry. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum OrgPrivateRegistryConfiguration_visibility + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Models/OrgRulesetConditions.cs b/src/GitHub/Models/OrgRulesetConditions.cs index 54355e477..64e35acf7 100644 --- a/src/GitHub/Models/OrgRulesetConditions.cs +++ b/src/GitHub/Models/OrgRulesetConditions.cs @@ -8,7 +8,7 @@ namespace GitHub.Models { /// - /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. + /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] public partial class OrgRulesetConditions : IAdditionalDataHolder, IParsable diff --git a/src/GitHub/Models/OrganizationSecretScanningAlert.cs b/src/GitHub/Models/OrganizationSecretScanningAlert.cs index baf2ffe4c..c82779037 100644 --- a/src/GitHub/Models/OrganizationSecretScanningAlert.cs +++ b/src/GitHub/Models/OrganizationSecretScanningAlert.cs @@ -73,6 +73,14 @@ public partial class OrganizationSecretScanningAlert : IAdditionalDataHolder, IP #nullable restore #else public global::GitHub.Models.NullableSimpleUser PushProtectionBypassRequestReviewer { get; set; } +#endif + /// An optional comment when reviewing a push protection bypass. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PushProtectionBypassRequestReviewerComment { get; set; } +#nullable restore +#else + public string PushProtectionBypassRequestReviewerComment { get; set; } #endif /// A GitHub repository. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -174,6 +182,7 @@ public virtual IDictionary> GetFieldDeserializers() { "push_protection_bypass_request_comment", n => { PushProtectionBypassRequestComment = n.GetStringValue(); } }, { "push_protection_bypass_request_html_url", n => { PushProtectionBypassRequestHtmlUrl = n.GetStringValue(); } }, { "push_protection_bypass_request_reviewer", n => { PushProtectionBypassRequestReviewer = n.GetObjectValue(global::GitHub.Models.NullableSimpleUser.CreateFromDiscriminatorValue); } }, + { "push_protection_bypass_request_reviewer_comment", n => { PushProtectionBypassRequestReviewerComment = n.GetStringValue(); } }, { "push_protection_bypassed", n => { PushProtectionBypassed = n.GetBoolValue(); } }, { "push_protection_bypassed_at", n => { PushProtectionBypassedAt = n.GetDateTimeOffsetValue(); } }, { "push_protection_bypassed_by", n => { PushProtectionBypassedBy = n.GetObjectValue(global::GitHub.Models.NullableSimpleUser.CreateFromDiscriminatorValue); } }, @@ -207,6 +216,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("push_protection_bypass_request_comment", PushProtectionBypassRequestComment); writer.WriteStringValue("push_protection_bypass_request_html_url", PushProtectionBypassRequestHtmlUrl); writer.WriteObjectValue("push_protection_bypass_request_reviewer", PushProtectionBypassRequestReviewer); + writer.WriteStringValue("push_protection_bypass_request_reviewer_comment", PushProtectionBypassRequestReviewerComment); writer.WriteObjectValue("repository", Repository); writer.WriteEnumValue("resolution", Resolution); writer.WriteStringValue("resolution_comment", ResolutionComment); diff --git a/src/GitHub/Models/RateLimitOverview_resources.cs b/src/GitHub/Models/RateLimitOverview_resources.cs index 163f0f2f4..bf7838b36 100644 --- a/src/GitHub/Models/RateLimitOverview_resources.cs +++ b/src/GitHub/Models/RateLimitOverview_resources.cs @@ -22,6 +22,14 @@ public partial class RateLimitOverview_resources : IAdditionalDataHolder, IParsa #endif /// 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_scanning_autofix property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.RateLimit? CodeScanningAutofix { get; set; } +#nullable restore +#else + public global::GitHub.Models.RateLimit CodeScanningAutofix { get; set; } +#endif /// The code_scanning_upload property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -120,6 +128,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "actions_runner_registration", n => { ActionsRunnerRegistration = n.GetObjectValue(global::GitHub.Models.RateLimit.CreateFromDiscriminatorValue); } }, + { "code_scanning_autofix", n => { CodeScanningAutofix = n.GetObjectValue(global::GitHub.Models.RateLimit.CreateFromDiscriminatorValue); } }, { "code_scanning_upload", n => { CodeScanningUpload = n.GetObjectValue(global::GitHub.Models.RateLimit.CreateFromDiscriminatorValue); } }, { "code_search", n => { CodeSearch = n.GetObjectValue(global::GitHub.Models.RateLimit.CreateFromDiscriminatorValue); } }, { "core", n => { Core = n.GetObjectValue(global::GitHub.Models.RateLimit.CreateFromDiscriminatorValue); } }, @@ -139,6 +148,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("actions_runner_registration", ActionsRunnerRegistration); + writer.WriteObjectValue("code_scanning_autofix", CodeScanningAutofix); writer.WriteObjectValue("code_scanning_upload", CodeScanningUpload); writer.WriteObjectValue("code_search", CodeSearch); writer.WriteObjectValue("core", Core); diff --git a/src/GitHub/Models/RepositoryRulePullRequest_parameters.cs b/src/GitHub/Models/RepositoryRulePullRequest_parameters.cs index 1a5264767..679b59017 100644 --- a/src/GitHub/Models/RepositoryRulePullRequest_parameters.cs +++ b/src/GitHub/Models/RepositoryRulePullRequest_parameters.cs @@ -14,6 +14,14 @@ public partial class RepositoryRulePullRequest_parameters : IAdditionalDataHolde { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + /// When merging pull requests, you can allow any combination of merge commits, squashing, or rebasing. At least one option must be enabled. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AllowedMergeMethods { get; set; } +#nullable restore +#else + public List AllowedMergeMethods { get; set; } +#endif /// New, reviewable commits pushed will dismiss previous pull request review approvals. public bool? DismissStaleReviewsOnPush { get; set; } /// Require an approving review in pull requests that modify files that have a designated code owner. @@ -49,6 +57,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { + { "allowed_merge_methods", n => { AllowedMergeMethods = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, { "dismiss_stale_reviews_on_push", n => { DismissStaleReviewsOnPush = n.GetBoolValue(); } }, { "require_code_owner_review", n => { RequireCodeOwnerReview = n.GetBoolValue(); } }, { "require_last_push_approval", n => { RequireLastPushApproval = n.GetBoolValue(); } }, @@ -63,6 +72,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("allowed_merge_methods", AllowedMergeMethods); writer.WriteBoolValue("dismiss_stale_reviews_on_push", DismissStaleReviewsOnPush); writer.WriteBoolValue("require_code_owner_review", RequireCodeOwnerReview); writer.WriteIntValue("required_approving_review_count", RequiredApprovingReviewCount); diff --git a/src/GitHub/Models/RepositoryRuleset_source_type.cs b/src/GitHub/Models/RepositoryRuleset_source_type.cs index 01dc26367..6e9822dc7 100644 --- a/src/GitHub/Models/RepositoryRuleset_source_type.cs +++ b/src/GitHub/Models/RepositoryRuleset_source_type.cs @@ -15,5 +15,9 @@ public enum RepositoryRuleset_source_type #pragma warning disable CS1591 Organization, #pragma warning restore CS1591 + [EnumMember(Value = "Enterprise")] + #pragma warning disable CS1591 + Enterprise, + #pragma warning restore CS1591 } } diff --git a/src/GitHub/Models/RepositoryRuleset_target.cs b/src/GitHub/Models/RepositoryRuleset_target.cs index d110e153d..4c1b59d78 100644 --- a/src/GitHub/Models/RepositoryRuleset_target.cs +++ b/src/GitHub/Models/RepositoryRuleset_target.cs @@ -19,5 +19,9 @@ public enum RepositoryRuleset_target #pragma warning disable CS1591 Push, #pragma warning restore CS1591 + [EnumMember(Value = "repository")] + #pragma warning disable CS1591 + Repository, + #pragma warning restore CS1591 } } diff --git a/src/GitHub/Models/SecretScanningAlert.cs b/src/GitHub/Models/SecretScanningAlert.cs index 2fa9c8efa..0ee84af55 100644 --- a/src/GitHub/Models/SecretScanningAlert.cs +++ b/src/GitHub/Models/SecretScanningAlert.cs @@ -73,6 +73,14 @@ public partial class SecretScanningAlert : IAdditionalDataHolder, IParsable #nullable restore #else public global::GitHub.Models.NullableSimpleUser PushProtectionBypassRequestReviewer { get; set; } +#endif + /// An optional comment when reviewing a push protection bypass. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PushProtectionBypassRequestReviewerComment { get; set; } +#nullable restore +#else + public string PushProtectionBypassRequestReviewerComment { get; set; } #endif /// **Required when the `state` is `resolved`.** The reason for resolving the alert. public global::GitHub.Models.SecretScanningAlertResolution? Resolution { get; set; } @@ -166,6 +174,7 @@ public virtual IDictionary> GetFieldDeserializers() { "push_protection_bypass_request_comment", n => { PushProtectionBypassRequestComment = n.GetStringValue(); } }, { "push_protection_bypass_request_html_url", n => { PushProtectionBypassRequestHtmlUrl = n.GetStringValue(); } }, { "push_protection_bypass_request_reviewer", n => { PushProtectionBypassRequestReviewer = n.GetObjectValue(global::GitHub.Models.NullableSimpleUser.CreateFromDiscriminatorValue); } }, + { "push_protection_bypass_request_reviewer_comment", n => { PushProtectionBypassRequestReviewerComment = n.GetStringValue(); } }, { "push_protection_bypassed", n => { PushProtectionBypassed = n.GetBoolValue(); } }, { "push_protection_bypassed_at", n => { PushProtectionBypassedAt = n.GetDateTimeOffsetValue(); } }, { "push_protection_bypassed_by", n => { PushProtectionBypassedBy = n.GetObjectValue(global::GitHub.Models.NullableSimpleUser.CreateFromDiscriminatorValue); } }, @@ -198,6 +207,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("push_protection_bypass_request_comment", PushProtectionBypassRequestComment); writer.WriteStringValue("push_protection_bypass_request_html_url", PushProtectionBypassRequestHtmlUrl); writer.WriteObjectValue("push_protection_bypass_request_reviewer", PushProtectionBypassRequestReviewer); + writer.WriteStringValue("push_protection_bypass_request_reviewer_comment", PushProtectionBypassRequestReviewerComment); writer.WriteEnumValue("resolution", Resolution); writer.WriteStringValue("resolution_comment", ResolutionComment); writer.WriteDateTimeOffsetValue("resolved_at", ResolvedAt); diff --git a/src/GitHub/Orgs/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs b/src/GitHub/Orgs/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs index 20970f8f9..78695983b 100644 --- a/src/GitHub/Orgs/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs +++ b/src/GitHub/Orgs/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs @@ -21,6 +21,14 @@ public partial class WithSubject_digestGetResponse_attestations : IAdditionalDat #nullable restore #else public global::GitHub.Orgs.Item.Attestations.Item.WithSubject_digestGetResponse_attestations_bundle Bundle { get; set; } +#endif + /// The bundle_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BundleUrl { get; set; } +#nullable restore +#else + public string BundleUrl { get; set; } #endif /// The repository_id property public int? RepositoryId { get; set; } @@ -50,6 +58,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "bundle", n => { Bundle = n.GetObjectValue(global::GitHub.Orgs.Item.Attestations.Item.WithSubject_digestGetResponse_attestations_bundle.CreateFromDiscriminatorValue); } }, + { "bundle_url", n => { BundleUrl = n.GetStringValue(); } }, { "repository_id", n => { RepositoryId = n.GetIntValue(); } }, }; } @@ -61,6 +70,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("bundle", Bundle); + writer.WriteStringValue("bundle_url", BundleUrl); writer.WriteIntValue("repository_id", RepositoryId); writer.WriteAdditionalData(AdditionalData); } diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_nameItemRequestBuilder.cs b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_nameItemRequestBuilder.cs new file mode 100644 index 000000000..2e84896b9 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_nameItemRequestBuilder.cs @@ -0,0 +1,183 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.Item +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\private-registries\{secret_name} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class WithSecret_nameItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSecret_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/{secret_name}", 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 WithSecret_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/{secret_name}", rawUrl) + { + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Delete a private registry configuration at the organization-level.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// API method documentation + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Get the configuration of a single private registry defined for an organization, omitting its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// API method documentation + /// + /// A + /// 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) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.OrgPrivateRegistryConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// API method documentation + /// + /// 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 404 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "422", global::GitHub.Models.ValidationError.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Delete a private registry configuration at the organization-level.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope 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 ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json"); + return requestInfo; + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Get the configuration of a single private registry defined for an organization, omitting its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope 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; + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` 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 ToPatchRequestInformation(global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, 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 global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_nameItemRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody.cs b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody.cs new file mode 100644 index 000000000..e8db272c4 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody.cs @@ -0,0 +1,103 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class WithSecret_namePatchRequestBody : 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 value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EncryptedValue { get; set; } +#nullable restore +#else + public string EncryptedValue { get; set; } +#endif + /// The ID of the key you used to encrypt the secret. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? KeyId { get; set; } +#nullable restore +#else + public string KeyId { get; set; } +#endif + /// The registry type. + public global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody_registry_type? RegistryType { get; set; } + /// An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedRepositoryIds { get; set; } +#nullable restore +#else + public List SelectedRepositoryIds { get; set; } +#endif + /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + public global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithSecret_namePatchRequestBody() + { + 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 global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_namePatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "encrypted_value", n => { EncryptedValue = n.GetStringValue(); } }, + { "key_id", n => { KeyId = n.GetStringValue(); } }, + { "registry_type", n => { RegistryType = n.GetEnumValue(); } }, + { "selected_repository_ids", n => { SelectedRepositoryIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + { "visibility", n => { Visibility = 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("encrypted_value", EncryptedValue); + writer.WriteStringValue("key_id", KeyId); + writer.WriteEnumValue("registry_type", RegistryType); + writer.WriteCollectionOfPrimitiveValues("selected_repository_ids", SelectedRepositoryIds); + writer.WriteStringValue("username", Username); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_registry_type.cs b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_registry_type.cs new file mode 100644 index 000000000..9d20522e2 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_registry_type.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.Item +{ + /// The registry type. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithSecret_namePatchRequestBody_registry_type + { + [EnumMember(Value = "maven_repository")] + #pragma warning disable CS1591 + Maven_repository, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_visibility.cs b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_visibility.cs new file mode 100644 index 000000000..44cf412a9 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/Item/WithSecret_namePatchRequestBody_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.Item +{ + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithSecret_namePatchRequestBody_visibility + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsGetResponse.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesGetResponse.cs similarity index 58% rename from src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsGetResponse.cs rename to src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesGetResponse.cs index 357fc4b2f..49fb73b94 100644 --- a/src/GitHub/Enterprises/Item/Copilot/Billing/Seats/SeatsGetResponse.cs +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesGetResponse.cs @@ -6,41 +6,41 @@ using System.Collections.Generic; using System.IO; using System; -namespace GitHub.Enterprises.Item.Copilot.Billing.Seats +namespace GitHub.Orgs.Item.PrivateRegistries { [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] #pragma warning disable CS1591 - public partial class SeatsGetResponse : IAdditionalDataHolder, IParsable + public partial class PrivateRegistriesGetResponse : 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 seats property + /// The configurations property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Seats { get; set; } + public List? Configurations { get; set; } #nullable restore #else - public List Seats { get; set; } + public List Configurations { get; set; } #endif - /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - public int? TotalSeats { get; set; } + /// The total_count property + public int? TotalCount { get; set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SeatsGetResponse() + public PrivateRegistriesGetResponse() { 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 global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new global::GitHub.Enterprises.Item.Copilot.Billing.Seats.SeatsGetResponse(); + return new global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesGetResponse(); } /// /// The deserialization information for the current model @@ -50,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "seats", n => { Seats = n.GetCollectionOfObjectValues(global::GitHub.Models.CopilotSeatDetails.CreateFromDiscriminatorValue)?.AsList(); } }, - { "total_seats", n => { TotalSeats = n.GetIntValue(); } }, + { "configurations", n => { Configurations = n.GetCollectionOfObjectValues(global::GitHub.Models.OrgPrivateRegistryConfiguration.CreateFromDiscriminatorValue)?.AsList(); } }, + { "total_count", n => { TotalCount = n.GetIntValue(); } }, }; } /// @@ -61,8 +61,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("seats", Seats); - writer.WriteIntValue("total_seats", TotalSeats); + writer.WriteCollectionOfObjectValues("configurations", Configurations); + writer.WriteIntValue("total_count", TotalCount); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody.cs new file mode 100644 index 000000000..4e008f29c --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody.cs @@ -0,0 +1,103 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class PrivateRegistriesPostRequestBody : 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 value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EncryptedValue { get; set; } +#nullable restore +#else + public string EncryptedValue { get; set; } +#endif + /// The ID of the key you used to encrypt the secret. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? KeyId { get; set; } +#nullable restore +#else + public string KeyId { get; set; } +#endif + /// The registry type. + public global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody_registry_type? RegistryType { get; set; } + /// An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedRepositoryIds { get; set; } +#nullable restore +#else + public List SelectedRepositoryIds { get; set; } +#endif + /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + public global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public PrivateRegistriesPostRequestBody() + { + 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 global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "encrypted_value", n => { EncryptedValue = n.GetStringValue(); } }, + { "key_id", n => { KeyId = n.GetStringValue(); } }, + { "registry_type", n => { RegistryType = n.GetEnumValue(); } }, + { "selected_repository_ids", n => { SelectedRepositoryIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "username", n => { Username = n.GetStringValue(); } }, + { "visibility", n => { Visibility = 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("encrypted_value", EncryptedValue); + writer.WriteStringValue("key_id", KeyId); + writer.WriteEnumValue("registry_type", RegistryType); + writer.WriteCollectionOfPrimitiveValues("selected_repository_ids", SelectedRepositoryIds); + writer.WriteStringValue("username", Username); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_registry_type.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_registry_type.cs new file mode 100644 index 000000000..7cc667776 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_registry_type.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries +{ + /// The registry type. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum PrivateRegistriesPostRequestBody_registry_type + { + [EnumMember(Value = "maven_repository")] + #pragma warning disable CS1591 + Maven_repository, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_visibility.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_visibility.cs new file mode 100644 index 000000000..6dbdb78e3 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesPostRequestBody_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries +{ + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum PrivateRegistriesPostRequestBody_visibility + { + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesRequestBuilder.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesRequestBuilder.cs new file mode 100644 index 000000000..364cd57dd --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PrivateRegistriesRequestBuilder.cs @@ -0,0 +1,174 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using GitHub.Orgs.Item.PrivateRegistries.Item; +using GitHub.Orgs.Item.PrivateRegistries.PublicKey; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\private-registries + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class PrivateRegistriesRequestBuilder : BaseRequestBuilder + { + /// The publicKey property + public global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyRequestBuilder PublicKey + { + get => new global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the GitHub.orgs.item.privateRegistries.item collection + /// The name of the secret. + /// A + public global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_nameItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("secret_name", position); + return new global::GitHub.Orgs.Item.PrivateRegistries.Item.WithSecret_nameItemRequestBuilder(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 PrivateRegistriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries{?page*,per_page*}", 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 PrivateRegistriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries{?page*,per_page*}", rawUrl) + { + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// API method documentation + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 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) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` 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 404 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "422", global::GitHub.Models.ValidationError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.OrgPrivateRegistryConfigurationWithSelectedRepositories.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope 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; + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` 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(global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesPostRequestBody 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 global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class PrivateRegistriesRequestBuilderGetQueryParameters + { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("page")] + public int? Page { get; set; } + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + [QueryParameter("per_page")] + public int? PerPage { get; set; } + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyGetResponse.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyGetResponse.cs new file mode 100644 index 000000000..075a5ae12 --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyGetResponse.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.PublicKey +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class PublicKeyGetResponse : 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 Base64 encoded public key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// The identifier for the key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? KeyId { get; set; } +#nullable restore +#else + public string KeyId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PublicKeyGetResponse() + { + 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 global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "key", n => { Key = n.GetStringValue(); } }, + { "key_id", n => { KeyId = 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("key", Key); + writer.WriteStringValue("key_id", KeyId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyRequestBuilder.cs b/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyRequestBuilder.cs new file mode 100644 index 000000000..153123bca --- /dev/null +++ b/src/GitHub/Orgs/Item/PrivateRegistries/PublicKey/PublicKeyRequestBuilder.cs @@ -0,0 +1,90 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.PrivateRegistries.PublicKey +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\private-registries\public-key + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class PublicKeyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PublicKeyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/public-key", 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 PublicKeyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/public-key", rawUrl) + { + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// API method documentation + /// + /// A + /// 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) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// > [!NOTE]> This endpoint is in public preview and is subject to change.Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope 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 global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.PrivateRegistries.PublicKey.PublicKeyRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 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 03a7b4a62..523410af4 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 @@ -89,18 +89,18 @@ public async Task DeleteAsync(Action /// /// A - /// The request body + /// Custom property set payload /// 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 PutAsync(global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PutAsync(global::GitHub.Models.CustomPropertySetPayload body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PutAsync(global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PutAsync(global::GitHub.Models.CustomPropertySetPayload body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -154,15 +154,15 @@ public RequestInformation ToGetRequestInformation(Action /// A - /// The request body + /// Custom property set payload /// 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 ToPutRequestInformation(global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody body, Action>? requestConfiguration = default) + public RequestInformation ToPutRequestInformation(global::GitHub.Models.CustomPropertySetPayload body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPutRequestInformation(global::GitHub.Orgs.Item.Properties.Schema.Item.WithCustom_property_namePutRequestBody body, Action> requestConfiguration = default) + public RequestInformation ToPutRequestInformation(global::GitHub.Models.CustomPropertySetPayload body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs index bc679b4fc..7bfee15aa 100644 --- a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs +++ b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody.cs @@ -23,7 +23,7 @@ public partial class WithRuleset_PutRequestBody : IAdditionalDataHolder, IParsab #else public List BypassActors { get; set; } #endif - /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. + /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; } diff --git a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody_target.cs b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody_target.cs index 82106eb4d..7ce123ecf 100644 --- a/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody_target.cs +++ b/src/GitHub/Orgs/Item/Rulesets/Item/WithRuleset_PutRequestBody_target.cs @@ -19,5 +19,9 @@ public enum WithRuleset_PutRequestBody_target #pragma warning disable CS1591 Push, #pragma warning restore CS1591 + [EnumMember(Value = "repository")] + #pragma warning disable CS1591 + Repository, + #pragma warning restore CS1591 } } diff --git a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs index 6cb995edb..54a7ea69a 100644 --- a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs +++ b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody.cs @@ -23,7 +23,7 @@ public partial class RulesetsPostRequestBody : IAdditionalDataHolder, IParsable #else public List BypassActors { get; set; } #endif - /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. + /// Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public global::GitHub.Models.OrgRulesetConditions? Conditions { get; set; } diff --git a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody_target.cs b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody_target.cs index 1e571ca94..fd9d5f444 100644 --- a/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody_target.cs +++ b/src/GitHub/Orgs/Item/Rulesets/RulesetsPostRequestBody_target.cs @@ -19,5 +19,9 @@ public enum RulesetsPostRequestBody_target #pragma warning disable CS1591 Push, #pragma warning restore CS1591 + [EnumMember(Value = "repository")] + #pragma warning disable CS1591 + Repository, + #pragma warning restore CS1591 } } diff --git a/src/GitHub/Orgs/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs b/src/GitHub/Orgs/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs index e43fc2aca..02acc89ed 100644 --- a/src/GitHub/Orgs/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs @@ -139,7 +139,7 @@ public partial class AlertsRequestBuilderGetQueryParameters [QueryParameter("resolution")] public string Resolution { get; set; } #endif - /// A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable [QueryParameter("secret_type")] diff --git a/src/GitHub/Orgs/Item/SecurityManagers/SecurityManagersRequestBuilder.cs b/src/GitHub/Orgs/Item/SecurityManagers/SecurityManagersRequestBuilder.cs index 0cf70fe7b..90fa1725f 100644 --- a/src/GitHub/Orgs/Item/SecurityManagers/SecurityManagersRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/SecurityManagers/SecurityManagersRequestBuilder.cs @@ -19,6 +19,7 @@ namespace GitHub.Orgs.Item.SecurityManagers public partial class SecurityManagersRequestBuilder : BaseRequestBuilder { /// The teams property + [Obsolete("")] public global::GitHub.Orgs.Item.SecurityManagers.Teams.TeamsRequestBuilder Teams { get => new global::GitHub.Orgs.Item.SecurityManagers.Teams.TeamsRequestBuilder(PathParameters, RequestAdapter); @@ -40,12 +41,13 @@ public SecurityManagersRequestBuilder(string rawUrl, IRequestAdapter requestAdap { } /// - /// Lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// API method documentation /// /// A List<global::GitHub.Models.TeamSimple> /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -60,10 +62,11 @@ public SecurityManagersRequestBuilder(string rawUrl, IRequestAdapter requestAdap return collectionResult?.AsList(); } /// - /// Lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) @@ -83,6 +86,7 @@ public RequestInformation ToGetRequestInformation(Action /// A /// The raw URL to use for the request builder. + [Obsolete("")] public global::GitHub.Orgs.Item.SecurityManagers.SecurityManagersRequestBuilder WithUrl(string rawUrl) { return new global::GitHub.Orgs.Item.SecurityManagers.SecurityManagersRequestBuilder(rawUrl, RequestAdapter); diff --git a/src/GitHub/Orgs/Item/SecurityManagers/Teams/Item/WithTeam_slugItemRequestBuilder.cs b/src/GitHub/Orgs/Item/SecurityManagers/Teams/Item/WithTeam_slugItemRequestBuilder.cs index 23e5b854d..d5cf06ceb 100644 --- a/src/GitHub/Orgs/Item/SecurityManagers/Teams/Item/WithTeam_slugItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/SecurityManagers/Teams/Item/WithTeam_slugItemRequestBuilder.cs @@ -33,11 +33,12 @@ public WithTeam_slugItemRequestBuilder(string rawUrl, IRequestAdapter requestAda { } /// - /// Removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// API method documentation /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -51,11 +52,12 @@ public async Task DeleteAsync(Action - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// API method documentation /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task PutAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -69,10 +71,11 @@ public async Task PutAsync(Action> await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); } /// - /// Removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) @@ -87,10 +90,11 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public RequestInformation ToPutRequestInformation(Action>? requestConfiguration = default) @@ -109,6 +113,7 @@ public RequestInformation ToPutRequestInformation(Action /// A /// The raw URL to use for the request builder. + [Obsolete("")] public global::GitHub.Orgs.Item.SecurityManagers.Teams.Item.WithTeam_slugItemRequestBuilder WithUrl(string rawUrl) { return new global::GitHub.Orgs.Item.SecurityManagers.Teams.Item.WithTeam_slugItemRequestBuilder(rawUrl, RequestAdapter); diff --git a/src/GitHub/Orgs/Item/SecurityManagers/Teams/TeamsRequestBuilder.cs b/src/GitHub/Orgs/Item/SecurityManagers/Teams/TeamsRequestBuilder.cs index 3077b2f0f..23d205eab 100644 --- a/src/GitHub/Orgs/Item/SecurityManagers/Teams/TeamsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/SecurityManagers/Teams/TeamsRequestBuilder.cs @@ -18,6 +18,7 @@ public partial class TeamsRequestBuilder : BaseRequestBuilder /// Gets an item from the GitHub.orgs.item.securityManagers.teams.item collection /// The slug of the team name. /// A + [Obsolete("")] public global::GitHub.Orgs.Item.SecurityManagers.Teams.Item.WithTeam_slugItemRequestBuilder this[string position] { get diff --git a/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs b/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs index 857ddbdc4..46c4582e0 100644 --- a/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs @@ -28,6 +28,7 @@ using GitHub.Orgs.Item.Packages; using GitHub.Orgs.Item.PersonalAccessTokenRequests; using GitHub.Orgs.Item.PersonalAccessTokens; +using GitHub.Orgs.Item.PrivateRegistries; using GitHub.Orgs.Item.Projects; using GitHub.Orgs.Item.Properties; using GitHub.Orgs.Item.Public_members; @@ -185,6 +186,11 @@ public partial class WithOrgItemRequestBuilder : BaseRequestBuilder { get => new global::GitHub.Orgs.Item.PersonalAccessTokens.PersonalAccessTokensRequestBuilder(PathParameters, RequestAdapter); } + /// The privateRegistries property + public global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesRequestBuilder PrivateRegistries + { + get => new global::GitHub.Orgs.Item.PrivateRegistries.PrivateRegistriesRequestBuilder(PathParameters, RequestAdapter); + } /// The projects property public global::GitHub.Orgs.Item.Projects.ProjectsRequestBuilder Projects { diff --git a/src/GitHub/Repos/Item/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs b/src/GitHub/Repos/Item/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs index 05667fad7..7de761f3c 100644 --- a/src/GitHub/Repos/Item/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs +++ b/src/GitHub/Repos/Item/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs @@ -21,6 +21,14 @@ public partial class WithSubject_digestGetResponse_attestations : IAdditionalDat #nullable restore #else public global::GitHub.Repos.Item.Item.Attestations.Item.WithSubject_digestGetResponse_attestations_bundle Bundle { get; set; } +#endif + /// The bundle_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BundleUrl { get; set; } +#nullable restore +#else + public string BundleUrl { get; set; } #endif /// The repository_id property public int? RepositoryId { get; set; } @@ -50,6 +58,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "bundle", n => { Bundle = n.GetObjectValue(global::GitHub.Repos.Item.Item.Attestations.Item.WithSubject_digestGetResponse_attestations_bundle.CreateFromDiscriminatorValue); } }, + { "bundle_url", n => { BundleUrl = n.GetStringValue(); } }, { "repository_id", n => { RepositoryId = n.GetIntValue(); } }, }; } @@ -61,6 +70,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("bundle", Bundle); + writer.WriteStringValue("bundle_url", BundleUrl); writer.WriteIntValue("repository_id", RepositoryId); writer.WriteAdditionalData(AdditionalData); } diff --git a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/AutofixRequestBuilder.cs b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/AutofixRequestBuilder.cs new file mode 100644 index 000000000..5e4aea517 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/AutofixRequestBuilder.cs @@ -0,0 +1,151 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix +{ + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\autofix + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class AutofixRequestBuilder : BaseRequestBuilder + { + /// The commits property + public global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits.CommitsRequestBuilder Commits + { + get => new global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits.CommitsRequestBuilder(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 AutofixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix", 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 AutofixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix", rawUrl) + { + } + /// + /// Gets the status and description of an autofix for a code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// API method documentation + /// + /// A + /// Cancellation token to use when cancelling requests + /// 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 404 status code + /// When receiving a 503 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> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "503", global::GitHub.Models.CodeScanningAutofix503Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeScanningAutofix.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an autofix for a code scanning alert.If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// API method documentation + /// + /// A + /// Cancellation token to use when cancelling requests + /// 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 404 status code + /// When receiving a 503 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "503", global::GitHub.Models.CodeScanningAutofix503Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeScanningAutofix.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the status and description of an autofix for a code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// 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; + } + /// + /// Creates an autofix for a code scanning alert.If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// 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 ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, 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 global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.AutofixRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.AutofixRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/Commits/CommitsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/Commits/CommitsRequestBuilder.cs new file mode 100644 index 000000000..a1fb09285 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/Autofix/Commits/CommitsRequestBuilder.cs @@ -0,0 +1,101 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits +{ + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\autofix\commits + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class CommitsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CommitsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix/commits", 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 CommitsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix/commits", rawUrl) + { + } + /// + /// Commits an autofix for a code scanning alert.If an autofix is commited as a result of this request, then this endpoint will return a 201 Created response.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// API method documentation + /// + /// A + /// Commit an autofix for a code scanning alert + /// Cancellation token to use when cancelling requests + /// 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 404 status code + /// When receiving a 503 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::GitHub.Models.CodeScanningAutofixCommits body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::GitHub.Models.CodeScanningAutofixCommits body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "403", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "404", global::GitHub.Models.BasicError.CreateFromDiscriminatorValue }, + { "503", global::GitHub.Models.CodeScanningAutofixCommitsResponse503Error.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.CodeScanningAutofixCommitsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Commits an autofix for a code scanning alert.If an autofix is commited as a result of this request, then this endpoint will return a 201 Created response.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// A + /// Commit an autofix for a code scanning alert + /// 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(global::GitHub.Models.CodeScanningAutofixCommits body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::GitHub.Models.CodeScanningAutofixCommits 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 global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits.CommitsRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.Commits.CommitsRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/WithAlert_numberItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/WithAlert_numberItemRequestBuilder.cs index e87723dda..45728a6d2 100644 --- a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/WithAlert_numberItemRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/Item/WithAlert_numberItemRequestBuilder.cs @@ -1,6 +1,7 @@ // #pragma warning disable CS0618 using GitHub.Models; +using GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix; using GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Instances; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions.Serialization; @@ -18,6 +19,11 @@ namespace GitHub.Repos.Item.Item.CodeScanning.Alerts.Item [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] public partial class WithAlert_numberItemRequestBuilder : BaseRequestBuilder { + /// The autofix property + public global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.AutofixRequestBuilder Autofix + { + get => new global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Autofix.AutofixRequestBuilder(PathParameters, RequestAdapter); + } /// The instances property public global::GitHub.Repos.Item.Item.CodeScanning.Alerts.Item.Instances.InstancesRequestBuilder Instances { diff --git a/src/GitHub/Repos/Item/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs index 5b1066063..c2f52fb08 100644 --- a/src/GitHub/Repos/Item/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/SecretScanning/Alerts/AlertsRequestBuilder.cs @@ -150,7 +150,7 @@ public partial class AlertsRequestBuilderGetQueryParameters [QueryParameter("resolution")] public string Resolution { get; set; } #endif - /// A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable [QueryParameter("secret_type")] diff --git a/src/GitHub/Users/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs b/src/GitHub/Users/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs index 48569835d..f49a89e7a 100644 --- a/src/GitHub/Users/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs +++ b/src/GitHub/Users/Item/Attestations/Item/WithSubject_digestGetResponse_attestations.cs @@ -22,6 +22,14 @@ public partial class WithSubject_digestGetResponse_attestations : IAdditionalDat #nullable restore #else public global::GitHub.Models.SigstoreBundle0 Bundle { get; set; } +#endif + /// The bundle_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BundleUrl { get; set; } +#nullable restore +#else + public string BundleUrl { get; set; } #endif /// The repository_id property public int? RepositoryId { get; set; } @@ -51,6 +59,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "bundle", n => { Bundle = n.GetObjectValue(global::GitHub.Models.SigstoreBundle0.CreateFromDiscriminatorValue); } }, + { "bundle_url", n => { BundleUrl = n.GetStringValue(); } }, { "repository_id", n => { RepositoryId = n.GetIntValue(); } }, }; } @@ -62,6 +71,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("bundle", Bundle); + writer.WriteStringValue("bundle_url", BundleUrl); writer.WriteIntValue("repository_id", RepositoryId); writer.WriteAdditionalData(AdditionalData); } diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 5b03cf873..f37a3aa13 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "6198535C8618DF52C604457271227C60CB25FBE843929DDB9970F53DB37EB9E31AEEA0A70CC974BC8F670CAEC656E55058A944AF09F1519B83FA55EA8A0076DA", + "descriptionHash": "54208FD0E974CC1715543AD344E8EB72FE62F45838301766C1CFBE3A6EDF1B14B8CFC3A84C4495B0B29B749D231789DB35F3CBFA101624FD7E5BF8FB1ECB51DD", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.19.0",