Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in generated code #36

Merged
merged 19 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Access_tokensRequestBuilder(string rawUrl, IRequestAdapter requestAdapter
{
}
/// <summary>
/// Creates an installation access token that enables a GitHub App to make authenticated API requests for the app&apos;s installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don&apos;t use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
/// Creates an installation access token that enables a GitHub App to make authenticated API requests for the app&apos;s installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don&apos;t use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.You must use a [JWT](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
/// API method documentation <see href="https://docs.github.com/enterprise-cloud@latest//rest/apps/apps#create-an-installation-access-token-for-an-app" />
/// </summary>
/// <returns>A <see cref="global::GitHub.Models.InstallationToken"/></returns>
Expand Down Expand Up @@ -66,7 +66,7 @@ public Access_tokensRequestBuilder(string rawUrl, IRequestAdapter requestAdapter
return await RequestAdapter.SendAsync<global::GitHub.Models.InstallationToken>(requestInfo, global::GitHub.Models.InstallationToken.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Creates an installation access token that enables a GitHub App to make authenticated API requests for the app&apos;s installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don&apos;t use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
/// Creates an installation access token that enables a GitHub App to make authenticated API requests for the app&apos;s installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don&apos;t use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.You must use a [JWT](https://docs.github.com/enterprise-cloud@latest//apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>
Expand Down
12 changes: 12 additions & 0 deletions src/GitHub/Enterprises/Item/AuditLog/AuditLogRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// <auto-generated/>
#pragma warning disable CS0618
using GitHub.Enterprises.Item.AuditLog.StreamKey;
using GitHub.Enterprises.Item.AuditLog.Streams;
using GitHub.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
Expand All @@ -17,6 +19,16 @@ namespace GitHub.Enterprises.Item.AuditLog
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public partial class AuditLogRequestBuilder : BaseRequestBuilder
{
/// <summary>The streamKey property</summary>
public global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder StreamKey
{
get => new global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>The streams property</summary>
public global::GitHub.Enterprises.Item.AuditLog.Streams.StreamsRequestBuilder Streams
{
get => new global::GitHub.Enterprises.Item.AuditLog.Streams.StreamsRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.AuditLog.AuditLogRequestBuilder"/> and sets the default values.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// <auto-generated/>
#pragma warning disable CS0618
using GitHub.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.Enterprises.Item.AuditLog.StreamKey
{
/// <summary>
/// Builds and executes requests for operations under \enterprises\{enterprise}\audit-log\stream-key
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public partial class StreamKeyRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public StreamKeyRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/audit-log/stream-key", pathParameters)
{
}
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public StreamKeyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enterprises/{enterprise}/audit-log/stream-key", rawUrl)
{
}
/// <summary>
/// Retrieves the audit log streaming public key for encrypting secrets.When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See &quot;[Encrypting secrets for the REST API](/rest/guides/encrypting-secrets-for-the-rest-api).&quot;
/// API method documentation <see href="https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets" />
/// </summary>
/// <returns>A <see cref="global::GitHub.Models.AuditLogStreamKey"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<global::GitHub.Models.AuditLogStreamKey?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<global::GitHub.Models.AuditLogStreamKey> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
return await RequestAdapter.SendAsync<global::GitHub.Models.AuditLogStreamKey>(requestInfo, global::GitHub.Models.AuditLogStreamKey.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Retrieves the audit log streaming public key for encrypting secrets.When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See &quot;[Encrypting secrets for the REST API](/rest/guides/encrypting-secrets-for-the-rest-api).&quot;
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
{
#nullable restore
#else
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
return requestInfo;
}
/// <summary>
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
/// </summary>
/// <returns>A <see cref="global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder"/></returns>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder WithUrl(string rawUrl)
{
return new global::GitHub.Enterprises.Item.AuditLog.StreamKey.StreamKeyRequestBuilder(rawUrl, RequestAdapter);
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions;
using System.Collections.Generic;
using System.IO;
using System;
namespace GitHub.Enterprises.Item.AuditLog.Streams.Item
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
#pragma warning disable CS1591
public partial class GetAuditLogStreamConfig422Error : ApiException, IAdditionalDataHolder, IParsable
#pragma warning restore CS1591
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The errors property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<string>? Errors { get; set; }
#nullable restore
#else
public List<string> Errors { get; set; }
#endif
/// <summary>The primary error message.</summary>
public override string Message { get => base.Message; }
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Enterprises.Item.AuditLog.Streams.Item.GetAuditLogStreamConfig422Error"/> and sets the default values.
/// </summary>
public GetAuditLogStreamConfig422Error()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::GitHub.Enterprises.Item.AuditLog.Streams.Item.GetAuditLogStreamConfig422Error"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Enterprises.Item.AuditLog.Streams.Item.GetAuditLogStreamConfig422Error CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Enterprises.Item.AuditLog.Streams.Item.GetAuditLogStreamConfig422Error();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "errors", n => { Errors = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
};
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteCollectionOfPrimitiveValues<string>("errors", Errors);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
Loading
Loading