diff --git a/src/GitHub/Models/RunnerGroupsOrg.cs b/src/GitHub/Models/RunnerGroupsOrg.cs new file mode 100644 index 000000000..31aa74445 --- /dev/null +++ b/src/GitHub/Models/RunnerGroupsOrg.cs @@ -0,0 +1,143 @@ +// +#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 RunnerGroupsOrg : 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 allows_public_repositories property + public bool? AllowsPublicRepositories { get; set; } + /// The default property + public bool? Default { get; set; } + /// The hosted_runners_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? HostedRunnersUrl { get; set; } +#nullable restore +#else + public string HostedRunnersUrl { get; set; } +#endif + /// The id property + public double? Id { get; set; } + /// The inherited property + public bool? Inherited { get; set; } + /// The inherited_allows_public_repositories property + public bool? InheritedAllowsPublicRepositories { get; set; } + /// The name property +#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 + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + public bool? RestrictedToWorkflows { get; set; } + /// The runners_url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunnersUrl { get; set; } +#nullable restore +#else + public string RunnersUrl { get; set; } +#endif + /// Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SelectedRepositoriesUrl { get; set; } +#nullable restore +#else + public string SelectedRepositoriesUrl { get; set; } +#endif + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedWorkflows { get; set; } +#nullable restore +#else + public List SelectedWorkflows { get; set; } +#endif + /// The visibility property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Visibility { get; set; } +#nullable restore +#else + public string Visibility { get; set; } +#endif + /// If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. + public bool? WorkflowRestrictionsReadOnly { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public RunnerGroupsOrg() + { + 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.RunnerGroupsOrg CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.RunnerGroupsOrg(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allows_public_repositories", n => { AllowsPublicRepositories = n.GetBoolValue(); } }, + { "default", n => { Default = n.GetBoolValue(); } }, + { "hosted_runners_url", n => { HostedRunnersUrl = n.GetStringValue(); } }, + { "id", n => { Id = n.GetDoubleValue(); } }, + { "inherited", n => { Inherited = n.GetBoolValue(); } }, + { "inherited_allows_public_repositories", n => { InheritedAllowsPublicRepositories = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "restricted_to_workflows", n => { RestrictedToWorkflows = n.GetBoolValue(); } }, + { "runners_url", n => { RunnersUrl = n.GetStringValue(); } }, + { "selected_repositories_url", n => { SelectedRepositoriesUrl = n.GetStringValue(); } }, + { "selected_workflows", n => { SelectedWorkflows = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "visibility", n => { Visibility = n.GetStringValue(); } }, + { "workflow_restrictions_read_only", n => { WorkflowRestrictionsReadOnly = 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("allows_public_repositories", AllowsPublicRepositories); + writer.WriteBoolValue("default", Default); + writer.WriteStringValue("hosted_runners_url", HostedRunnersUrl); + writer.WriteDoubleValue("id", Id); + writer.WriteBoolValue("inherited", Inherited); + writer.WriteBoolValue("inherited_allows_public_repositories", InheritedAllowsPublicRepositories); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("restricted_to_workflows", RestrictedToWorkflows); + writer.WriteStringValue("runners_url", RunnersUrl); + writer.WriteStringValue("selected_repositories_url", SelectedRepositoriesUrl); + writer.WriteCollectionOfPrimitiveValues("selected_workflows", SelectedWorkflows); + writer.WriteStringValue("visibility", Visibility); + writer.WriteBoolValue("workflow_restrictions_read_only", WorkflowRestrictionsReadOnly); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/SecurityAndAnalysis.cs b/src/GitHub/Models/SecurityAndAnalysis.cs index a27ee4309..cbbbd3190 100644 --- a/src/GitHub/Models/SecurityAndAnalysis.cs +++ b/src/GitHub/Models/SecurityAndAnalysis.cs @@ -37,6 +37,14 @@ public partial class SecurityAndAnalysis : IAdditionalDataHolder, IParsable #nullable restore #else public global::GitHub.Models.SecurityAndAnalysis_secret_scanning SecretScanning { get; set; } +#endif + /// The secret_scanning_ai_detection property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Models.SecurityAndAnalysis_secret_scanning_ai_detection? SecretScanningAiDetection { get; set; } +#nullable restore +#else + public global::GitHub.Models.SecurityAndAnalysis_secret_scanning_ai_detection SecretScanningAiDetection { get; set; } #endif /// The secret_scanning_non_provider_patterns property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -82,6 +90,7 @@ public virtual IDictionary> GetFieldDeserializers() { "advanced_security", n => { AdvancedSecurity = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_advanced_security.CreateFromDiscriminatorValue); } }, { "dependabot_security_updates", n => { DependabotSecurityUpdates = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_dependabot_security_updates.CreateFromDiscriminatorValue); } }, { "secret_scanning", n => { SecretScanning = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_secret_scanning.CreateFromDiscriminatorValue); } }, + { "secret_scanning_ai_detection", n => { SecretScanningAiDetection = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_secret_scanning_ai_detection.CreateFromDiscriminatorValue); } }, { "secret_scanning_non_provider_patterns", n => { SecretScanningNonProviderPatterns = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_secret_scanning_non_provider_patterns.CreateFromDiscriminatorValue); } }, { "secret_scanning_push_protection", n => { SecretScanningPushProtection = n.GetObjectValue(global::GitHub.Models.SecurityAndAnalysis_secret_scanning_push_protection.CreateFromDiscriminatorValue); } }, }; @@ -96,6 +105,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("advanced_security", AdvancedSecurity); writer.WriteObjectValue("dependabot_security_updates", DependabotSecurityUpdates); writer.WriteObjectValue("secret_scanning", SecretScanning); + writer.WriteObjectValue("secret_scanning_ai_detection", SecretScanningAiDetection); writer.WriteObjectValue("secret_scanning_non_provider_patterns", SecretScanningNonProviderPatterns); writer.WriteObjectValue("secret_scanning_push_protection", SecretScanningPushProtection); writer.WriteAdditionalData(AdditionalData); diff --git a/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection.cs b/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection.cs new file mode 100644 index 000000000..08a76a923 --- /dev/null +++ b/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection.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.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class SecurityAndAnalysis_secret_scanning_ai_detection : 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 status property + public global::GitHub.Models.SecurityAndAnalysis_secret_scanning_ai_detection_status? Status { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public SecurityAndAnalysis_secret_scanning_ai_detection() + { + 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.SecurityAndAnalysis_secret_scanning_ai_detection CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.SecurityAndAnalysis_secret_scanning_ai_detection(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "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.WriteEnumValue("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection_status.cs b/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection_status.cs new file mode 100644 index 000000000..2ddcc32f3 --- /dev/null +++ b/src/GitHub/Models/SecurityAndAnalysis_secret_scanning_ai_detection_status.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public enum SecurityAndAnalysis_secret_scanning_ai_detection_status + #pragma warning restore CS1591 + { + [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/Orgs/Item/Actions/ActionsRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/ActionsRequestBuilder.cs index 298ca452b..9bd578b48 100644 --- a/src/GitHub/Orgs/Item/Actions/ActionsRequestBuilder.cs +++ b/src/GitHub/Orgs/Item/Actions/ActionsRequestBuilder.cs @@ -3,6 +3,7 @@ using GitHub.Orgs.Item.Actions.Cache; using GitHub.Orgs.Item.Actions.Oidc; using GitHub.Orgs.Item.Actions.Permissions; +using GitHub.Orgs.Item.Actions.RunnerGroups; using GitHub.Orgs.Item.Actions.Runners; using GitHub.Orgs.Item.Actions.Secrets; using GitHub.Orgs.Item.Actions.Variables; @@ -35,6 +36,11 @@ public partial class ActionsRequestBuilder : BaseRequestBuilder { get => new global::GitHub.Orgs.Item.Actions.Permissions.PermissionsRequestBuilder(PathParameters, RequestAdapter); } + /// The runnerGroups property + public global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsRequestBuilder RunnerGroups + { + get => new global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsRequestBuilder(PathParameters, RequestAdapter); + } /// The runners property public global::GitHub.Orgs.Item.Actions.Runners.RunnersRequestBuilder Runners { diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/Item/WithRepository_ItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/Item/WithRepository_ItemRequestBuilder.cs new file mode 100644 index 000000000..dde92e625 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/Item/WithRepository_ItemRequestBuilder.cs @@ -0,0 +1,118 @@ +// +#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.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.Item +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\repositories\{repository_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class WithRepository_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRepository_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_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 WithRepository_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}", rawUrl) + { + } + /// + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."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. +#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); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."OAuth 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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPutRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."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); + return requestInfo; + } + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."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 ToPutRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + 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.Actions.RunnerGroups.Item.Repositories.Item.WithRepository_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.Item.WithRepository_ItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesGetResponse.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesGetResponse.cs new file mode 100644 index 000000000..f8b1cba4f --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesGetResponse.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.Orgs.Item.Actions.RunnerGroups.Item.Repositories +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RepositoriesGetResponse : 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 repositories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Repositories { get; set; } +#nullable restore +#else + public List Repositories { get; set; } +#endif + /// The total_count property + public double? TotalCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public RepositoriesGetResponse() + { + 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.Actions.RunnerGroups.Item.Repositories.RepositoriesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "repositories", n => { Repositories = n.GetCollectionOfObjectValues(global::GitHub.Models.MinimalRepository.CreateFromDiscriminatorValue)?.AsList(); } }, + { "total_count", n => { TotalCount = n.GetDoubleValue(); } }, + }; + } + /// + /// 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.WriteCollectionOfObjectValues("repositories", Repositories); + writer.WriteDoubleValue("total_count", TotalCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesPutRequestBody.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesPutRequestBody.cs new file mode 100644 index 000000000..f6a1016da --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesPutRequestBody.cs @@ -0,0 +1,65 @@ +// +#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.Actions.RunnerGroups.Item.Repositories +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RepositoriesPutRequestBody : 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; } + /// List of repository IDs that can access the runner group. +#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 + /// + /// Instantiates a new and sets the default values. + /// + public RepositoriesPutRequestBody() + { + 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.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "selected_repository_ids", n => { SelectedRepositoryIds = 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("selected_repository_ids", SelectedRepositoryIds); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesRequestBuilder.cs new file mode 100644 index 000000000..3e6e9c9a7 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Repositories/RepositoriesRequestBuilder.cs @@ -0,0 +1,151 @@ +// +#pragma warning disable CS0618 +using GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.Item; +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.Actions.RunnerGroups.Item.Repositories +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\repositories + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RepositoriesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the GitHub.orgs.item.actions.runnerGroups.item.repositories.item collection + /// The unique identifier of the repository. + /// A + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.Item.WithRepository_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("repository_id", position); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.Item.WithRepository_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 RepositoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories{?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 RepositoriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories{?page*,per_page*}", rawUrl) + { + } + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization.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. +#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); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization.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; + } + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.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 ToPutRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + 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.Actions.RunnerGroups.Item.Repositories.RepositoriesRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization.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 RepositoriesRequestBuilderGetQueryParameters + { + /// 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/Actions/RunnerGroups/Item/Runners/Item/WithRunner_ItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/Item/WithRunner_ItemRequestBuilder.cs new file mode 100644 index 000000000..f5df9b87c --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/Item/WithRunner_ItemRequestBuilder.cs @@ -0,0 +1,118 @@ +// +#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.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.Item +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\runners\{runner_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class WithRunner_ItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRunner_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_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 WithRunner_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", rawUrl) + { + } + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.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. +#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); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds a self-hosted runner to a runner group configured in an organization.OAuth 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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPutRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.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); + return requestInfo; + } + /// + /// Adds a self-hosted runner to a runner group configured in an organization.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 ToPutRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + 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.Actions.RunnerGroups.Item.Runners.Item.WithRunner_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.Item.WithRunner_ItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersGetResponse.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersGetResponse.cs new file mode 100644 index 000000000..a0f64198c --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersGetResponse.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.Orgs.Item.Actions.RunnerGroups.Item.Runners +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RunnersGetResponse : 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 runners property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Runners { get; set; } +#nullable restore +#else + public List Runners { get; set; } +#endif + /// The total_count property + public double? TotalCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public RunnersGetResponse() + { + 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.Actions.RunnerGroups.Item.Runners.RunnersGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "runners", n => { Runners = n.GetCollectionOfObjectValues(global::GitHub.Models.Runner.CreateFromDiscriminatorValue)?.AsList(); } }, + { "total_count", n => { TotalCount = n.GetDoubleValue(); } }, + }; + } + /// + /// 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.WriteCollectionOfObjectValues("runners", Runners); + writer.WriteDoubleValue("total_count", TotalCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersPutRequestBody.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersPutRequestBody.cs new file mode 100644 index 000000000..eec46ee83 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersPutRequestBody.cs @@ -0,0 +1,65 @@ +// +#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.Actions.RunnerGroups.Item.Runners +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RunnersPutRequestBody : 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; } + /// List of runner IDs to add to the runner group. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Runners { get; set; } +#nullable restore +#else + public List Runners { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RunnersPutRequestBody() + { + 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.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "runners", n => { Runners = 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("runners", Runners); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersRequestBuilder.cs new file mode 100644 index 000000000..19b033771 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/Runners/RunnersRequestBuilder.cs @@ -0,0 +1,151 @@ +// +#pragma warning disable CS0618 +using GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.Item; +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.Actions.RunnerGroups.Item.Runners +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\runners + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RunnersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the GitHub.orgs.item.actions.runnerGroups.item.runners.item collection + /// Unique identifier of the self-hosted runner. + /// A + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.Item.WithRunner_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("runner_id", position); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.Item.WithRunner_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 RunnersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners{?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 RunnersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners{?page*,per_page*}", rawUrl) + { + } + /// + /// Lists self-hosted runners that are in a specific organization group.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. +#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); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group.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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists self-hosted runners that are in a specific organization group.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; + } + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group.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 ToPutRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersPutRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + 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.Actions.RunnerGroups.Item.Runners.RunnersRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists self-hosted runners that are in a specific organization group.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 RunnersRequestBuilderGetQueryParameters + { + /// 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/Actions/RunnerGroups/Item/WithRunner_group_ItemRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_ItemRequestBuilder.cs new file mode 100644 index 000000000..578e7b45c --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_ItemRequestBuilder.cs @@ -0,0 +1,176 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories; +using GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners; +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.Actions.RunnerGroups.Item +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class WithRunner_group_ItemRequestBuilder : BaseRequestBuilder + { + /// The repositories property + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesRequestBuilder Repositories + { + get => new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Repositories.RepositoriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The runners property + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersRequestBuilder Runners + { + get => new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.Runners.RunnersRequestBuilder(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 WithRunner_group_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_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 WithRunner_group_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}", rawUrl) + { + } + /// + /// Deletes a self-hosted runner group for an organization.OAuth 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. +#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); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a specific self-hosted runner group for an organization.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. +#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); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.RunnerGroupsOrg.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization.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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.RunnerGroupsOrg.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a self-hosted runner group for an organization.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 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); + return requestInfo; + } + /// + /// Gets a specific self-hosted runner group for an organization.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; + } + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization.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.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_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.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_ItemRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_ItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody.cs new file mode 100644 index 000000000..f2b2f7d15 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody.cs @@ -0,0 +1,87 @@ +// +#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.Actions.RunnerGroups.Item +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class WithRunner_group_PatchRequestBody : 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; } + /// Whether the runner group can be used by `public` repositories. + public bool? AllowsPublicRepositories { get; set; } + /// Name of the runner group. +#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 + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + public bool? RestrictedToWorkflows { get; set; } + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedWorkflows { get; set; } +#nullable restore +#else + public List SelectedWorkflows { get; set; } +#endif + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public WithRunner_group_PatchRequestBody() + { + 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.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_PatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allows_public_repositories", n => { AllowsPublicRepositories = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "restricted_to_workflows", n => { RestrictedToWorkflows = n.GetBoolValue(); } }, + { "selected_workflows", n => { SelectedWorkflows = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "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.WriteBoolValue("allows_public_repositories", AllowsPublicRepositories); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("restricted_to_workflows", RestrictedToWorkflows); + writer.WriteCollectionOfPrimitiveValues("selected_workflows", SelectedWorkflows); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody_visibility.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody_visibility.cs new file mode 100644 index 000000000..d37fb6bc7 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/Item/WithRunner_group_PatchRequestBody_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.Actions.RunnerGroups.Item +{ + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum WithRunner_group_PatchRequestBody_visibility + { + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsGetResponse.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsGetResponse.cs new file mode 100644 index 000000000..36b65d5b9 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsGetResponse.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.Orgs.Item.Actions.RunnerGroups +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RunnerGroupsGetResponse : 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 runner_groups property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? RunnerGroups { get; set; } +#nullable restore +#else + public List RunnerGroups { get; set; } +#endif + /// The total_count property + public double? TotalCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public RunnerGroupsGetResponse() + { + 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.Actions.RunnerGroups.RunnerGroupsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "runner_groups", n => { RunnerGroups = n.GetCollectionOfObjectValues(global::GitHub.Models.RunnerGroupsOrg.CreateFromDiscriminatorValue)?.AsList(); } }, + { "total_count", n => { TotalCount = n.GetDoubleValue(); } }, + }; + } + /// + /// 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.WriteCollectionOfObjectValues("runner_groups", RunnerGroups); + writer.WriteDoubleValue("total_count", TotalCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody.cs new file mode 100644 index 000000000..2aed0c06b --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody.cs @@ -0,0 +1,108 @@ +// +#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.Actions.RunnerGroups +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + #pragma warning disable CS1591 + public partial class RunnerGroupsPostRequestBody : 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; } + /// Whether the runner group can be used by `public` repositories. + public bool? AllowsPublicRepositories { get; set; } + /// Name of the runner group. +#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 + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + public bool? RestrictedToWorkflows { get; set; } + /// List of runner IDs to add to the runner group. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Runners { get; set; } +#nullable restore +#else + public List Runners { get; set; } +#endif + /// List of repository IDs that can access the runner group. +#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 + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SelectedWorkflows { get; set; } +#nullable restore +#else + public List SelectedWorkflows { get; set; } +#endif + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + public global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody_visibility? Visibility { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public RunnerGroupsPostRequestBody() + { + AdditionalData = new Dictionary(); + Visibility = global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody_visibility.All; + } + /// + /// 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.Actions.RunnerGroups.RunnerGroupsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "allows_public_repositories", n => { AllowsPublicRepositories = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "restricted_to_workflows", n => { RestrictedToWorkflows = n.GetBoolValue(); } }, + { "runners", n => { Runners = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "selected_repository_ids", n => { SelectedRepositoryIds = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "selected_workflows", n => { SelectedWorkflows = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "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.WriteBoolValue("allows_public_repositories", AllowsPublicRepositories); + writer.WriteStringValue("name", Name); + writer.WriteBoolValue("restricted_to_workflows", RestrictedToWorkflows); + writer.WriteCollectionOfPrimitiveValues("runners", Runners); + writer.WriteCollectionOfPrimitiveValues("selected_repository_ids", SelectedRepositoryIds); + writer.WriteCollectionOfPrimitiveValues("selected_workflows", SelectedWorkflows); + writer.WriteEnumValue("visibility", Visibility); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody_visibility.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody_visibility.cs new file mode 100644 index 000000000..a6b098508 --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsPostRequestBody_visibility.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace GitHub.Orgs.Item.Actions.RunnerGroups +{ + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public enum RunnerGroupsPostRequestBody_visibility + { + [EnumMember(Value = "selected")] + #pragma warning disable CS1591 + Selected, + #pragma warning restore CS1591 + [EnumMember(Value = "all")] + #pragma warning disable CS1591 + All, + #pragma warning restore CS1591 + [EnumMember(Value = "private")] + #pragma warning disable CS1591 + Private, + #pragma warning restore CS1591 + } +} diff --git a/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsRequestBuilder.cs b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsRequestBuilder.cs new file mode 100644 index 000000000..34193430d --- /dev/null +++ b/src/GitHub/Orgs/Item/Actions/RunnerGroups/RunnerGroupsRequestBuilder.cs @@ -0,0 +1,164 @@ +// +#pragma warning disable CS0618 +using GitHub.Models; +using GitHub.Orgs.Item.Actions.RunnerGroups.Item; +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.Actions.RunnerGroups +{ + /// + /// Builds and executes requests for operations under \orgs\{org}\actions\runner-groups + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RunnerGroupsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the GitHub.orgs.item.actions.runnerGroups.item collection + /// Unique identifier of the self-hosted runner group. + /// A + public global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_ItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("runner_group_id", position); + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.Item.WithRunner_group_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 RunnerGroupsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups{?page*,per_page*,visible_to_repository*}", 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 RunnerGroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups{?page*,per_page*,visible_to_repository*}", rawUrl) + { + } + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.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. +#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); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new self-hosted runner group for an organization.OAuth 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. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, global::GitHub.Models.RunnerGroupsOrg.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.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; + } + /// + /// Creates a new self-hosted runner group for an organization.OAuth 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.Actions.RunnerGroups.RunnerGroupsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsPostRequestBody 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.Actions.RunnerGroups.RunnerGroupsRequestBuilder WithUrl(string rawUrl) + { + return new global::GitHub.Orgs.Item.Actions.RunnerGroups.RunnerGroupsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.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 RunnerGroupsRequestBuilderGetQueryParameters + { + /// 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; } + /// Only return runner groups that are allowed to be used by this repository. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("visible_to_repository")] + public string? VisibleToRepository { get; set; } +#nullable restore +#else + [QueryParameter("visible_to_repository")] + public string VisibleToRepository { get; set; } +#endif + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/AlertsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/AlertsRequestBuilder.cs index 14d7d1d1f..c5c1bb443 100644 --- a/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/AlertsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/CodeScanning/Alerts/AlertsRequestBuilder.cs @@ -35,7 +35,7 @@ public partial class AlertsRequestBuilder : BaseRequestBuilder /// /// Path parameters for the request /// The request adapter to use to execute the requests. - public AlertsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?direction*,page*,per_page*,pr*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters) + public AlertsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?after*,before*,direction*,page*,per_page*,pr*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters) { } /// @@ -43,7 +43,7 @@ public AlertsRequestBuilder(Dictionary pathParameters, IRequestA /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. - public AlertsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?direction*,page*,per_page*,pr*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", rawUrl) + public AlertsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?after*,before*,direction*,page*,per_page*,pr*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", rawUrl) { } /// @@ -109,6 +109,26 @@ public RequestInformation ToGetRequestInformation(ActionA 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 direction to sort the results by. [QueryParameter("direction")] public global::GitHub.Repos.Item.Item.CodeScanning.Alerts.GetDirectionQueryParameterType? Direction { get; set; } diff --git a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis.cs b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis.cs index eb7b07030..3770ddaa3 100644 --- a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis.cs +++ b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis.cs @@ -30,6 +30,14 @@ public partial class RepoPatchRequestBody_security_and_analysis : IAdditionalDat #nullable restore #else public global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning SecretScanning { get; set; } +#endif + /// Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection? SecretScanningAiDetection { get; set; } +#nullable restore +#else + public global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection SecretScanningAiDetection { get; set; } #endif /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -74,6 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "advanced_security", n => { AdvancedSecurity = n.GetObjectValue(global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_advanced_security.CreateFromDiscriminatorValue); } }, { "secret_scanning", n => { SecretScanning = n.GetObjectValue(global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning.CreateFromDiscriminatorValue); } }, + { "secret_scanning_ai_detection", n => { SecretScanningAiDetection = n.GetObjectValue(global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection.CreateFromDiscriminatorValue); } }, { "secret_scanning_non_provider_patterns", n => { SecretScanningNonProviderPatterns = n.GetObjectValue(global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_non_provider_patterns.CreateFromDiscriminatorValue); } }, { "secret_scanning_push_protection", n => { SecretScanningPushProtection = n.GetObjectValue(global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection.CreateFromDiscriminatorValue); } }, }; @@ -87,6 +96,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("advanced_security", AdvancedSecurity); writer.WriteObjectValue("secret_scanning", SecretScanning); + writer.WriteObjectValue("secret_scanning_ai_detection", SecretScanningAiDetection); writer.WriteObjectValue("secret_scanning_non_provider_patterns", SecretScanningNonProviderPatterns); writer.WriteObjectValue("secret_scanning_push_protection", SecretScanningPushProtection); writer.WriteAdditionalData(AdditionalData); diff --git a/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection.cs b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection.cs new file mode 100644 index 000000000..acca056d4 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection.cs @@ -0,0 +1,66 @@ +// +#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.Repos.Item.Item +{ + /// + /// Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")] + public partial class RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection : 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; } + /// Can be `enabled` or `disabled`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status { get; set; } +#nullable restore +#else + public string Status { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection() + { + 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.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Repos.Item.Item.RepoPatchRequestBody_security_and_analysis_secret_scanning_ai_detection(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "status", n => { Status = 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("status", Status); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 7997dbcaf..aaf3f3f70 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "EA698BC7497F85C1F3E0C1C93F75DD34E46061D805E4911F4D5D793DD64175ED973225D7BE26ECE3CD573F81CC73B67754D11D319E92BE53DF64EC3815851141", + "descriptionHash": "38F5552DBD6B10AB63A1C3596924D8A60195AAD9C7C82D006742A8EA9E68B6E28E3C1397C4249A7B85BC3A95BFE22F8384A08D02EC6A581325966A7DF9CE9224", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.19.0",