From 0c25b6f0732a3fcebe6a706644e257524b4b3a31 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 7 Mar 2024 12:19:41 -0600 Subject: [PATCH] FEAT: Added/Updated [WithSecret_nameItemRequestBuilder, RequestInformation, WithSecret_namePutRequestBody, PublicKeyRequestBuilder, SecretsGetResponse, SecretsRequestBuilder, WithNameItemRequestBuilder, WithNamePatchRequestBody, VariablesGetResponse, VariablesPostRequestBody, VariablesRequestBuilder]| Removed [WithRepository_ItemRequestBuilder] (#47) --- .../Item/WithSecret_nameItemRequestBuilder.cs | 144 ++++++++++++++++++ .../Item/WithSecret_namePutRequestBody.cs | 63 ++++++++ .../PublicKey/PublicKeyRequestBuilder.cs | 73 +++++++++ .../Item/Secrets/SecretsGetResponse.cs | 58 +++++++ .../Item/Secrets/SecretsRequestBuilder.cs | 97 ++++++++++++ .../Item/WithNameItemRequestBuilder.cs | 142 +++++++++++++++++ .../Item/WithNamePatchRequestBody.cs | 63 ++++++++ .../Item/Variables/VariablesGetResponse.cs | 58 +++++++ .../Variables/VariablesPostRequestBody.cs | 63 ++++++++ .../Item/Variables/VariablesRequestBuilder.cs | 132 ++++++++++++++++ .../WithEnvironment_nameItemRequestBuilder.cs | 10 ++ .../MatchingRefsRequestBuilder.cs | 2 +- .../Item/Item/Git/Ref/RefRequestBuilder.cs | 2 +- .../Refs/Item/WithRefItemRequestBuilder.cs | 10 +- .../Item/Item/Git/Refs/RefsRequestBuilder.cs | 2 +- .../RepositoriesRequestBuilder.cs | 9 -- src/GitHub/kiota-lock.json | 4 +- 17 files changed, 916 insertions(+), 16 deletions(-) create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_nameItemRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_namePutRequestBody.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Secrets/PublicKey/PublicKeyRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsGetResponse.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNameItemRequestBuilder.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNamePatchRequestBody.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesGetResponse.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesPostRequestBody.cs create mode 100644 src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesRequestBuilder.cs diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_nameItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_nameItemRequestBuilder.cs new file mode 100644 index 00000000..f1894f39 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_nameItemRequestBuilder.cs @@ -0,0 +1,144 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Secrets.Item { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\{secret_name} + /// + public class WithSecret_nameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSecret_nameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/{secret_name}", pathParameters) { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSecret_nameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/{secret_name}", rawUrl) { + } + /// + /// Deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` 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 single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` 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, ActionsSecret.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// API method documentation + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(WithSecret_namePutRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PutAsync(WithSecret_namePutRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, EmptyObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` 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 single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` 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 or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(WithSecret_namePutRequestBody body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(WithSecret_namePutRequestBody body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public WithSecret_nameItemRequestBuilder WithUrl(string rawUrl) { + return new WithSecret_nameItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_namePutRequestBody.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_namePutRequestBody.cs new file mode 100644 index 00000000..d5becfe5 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/Item/WithSecret_namePutRequestBody.cs @@ -0,0 +1,63 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Secrets.Item { + public class WithSecret_namePutRequestBody : 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; } + /// Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EncryptedValue { get; set; } +#nullable restore +#else + public string EncryptedValue { get; set; } +#endif + /// ID of the key you used to encrypt the secret. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? KeyId { get; set; } +#nullable restore +#else + public string KeyId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithSecret_namePutRequestBody() { + 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 WithSecret_namePutRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WithSecret_namePutRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"encrypted_value", n => { EncryptedValue = n.GetStringValue(); } }, + {"key_id", n => { KeyId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("encrypted_value", EncryptedValue); + writer.WriteStringValue("key_id", KeyId); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/PublicKey/PublicKeyRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/PublicKey/PublicKeyRequestBuilder.cs new file mode 100644 index 00000000..2317b0f8 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/PublicKey/PublicKeyRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Secrets.PublicKey { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\public-key + /// + public class PublicKeyRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PublicKeyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/public-key", pathParameters) { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PublicKeyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/public-key", rawUrl) { + } + /// + /// Get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` 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, ActionsPublicKey.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public PublicKeyRequestBuilder WithUrl(string rawUrl) { + return new PublicKeyRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsGetResponse.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsGetResponse.cs new file mode 100644 index 00000000..8324c504 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsGetResponse.cs @@ -0,0 +1,58 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Secrets { + public class SecretsGetResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The secrets property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Secrets { get; set; } +#nullable restore +#else + public List Secrets { get; set; } +#endif + /// The total_count property + public int? TotalCount { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public SecretsGetResponse() { + 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 SecretsGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SecretsGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"secrets", n => { Secrets = n.GetCollectionOfObjectValues(ActionsSecret.CreateFromDiscriminatorValue)?.ToList(); } }, + {"total_count", n => { TotalCount = n.GetIntValue(); } }, + }; + } + /// + /// 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("secrets", Secrets); + writer.WriteIntValue("total_count", TotalCount); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsRequestBuilder.cs new file mode 100644 index 00000000..e2c4eab2 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Secrets/SecretsRequestBuilder.cs @@ -0,0 +1,97 @@ +// +using GitHub.Repos.Item.Item.Environments.Item.Secrets.Item; +using GitHub.Repos.Item.Item.Environments.Item.Secrets.PublicKey; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Secrets { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets + /// + public class SecretsRequestBuilder : BaseRequestBuilder { + /// The publicKey property + public PublicKeyRequestBuilder PublicKey { get => + new PublicKeyRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the GitHub.repos.item.item.environments.item.secrets.item collection + /// The name of the secret. + /// A + public WithSecret_nameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("secret_name", position); + return new WithSecret_nameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SecretsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets{?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 SecretsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets{?page*,per_page*}", rawUrl) { + } + /// + /// Lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` 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, SecretsGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public SecretsRequestBuilder WithUrl(string rawUrl) { + return new SecretsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + public class SecretsRequestBuilderGetQueryParameters { + /// 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; } + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNameItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 00000000..b7d3c372 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Variables.Item { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables/{name}", pathParameters) { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables/{name}", rawUrl) { + } + /// + /// Deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` 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 variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` 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, ActionsVariable.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` 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 PatchAsync(WithNamePatchRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PatchAsync(WithNamePatchRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` 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 variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` 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 an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WithNamePatchRequestBody body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WithNamePatchRequestBody body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, 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 WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNamePatchRequestBody.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNamePatchRequestBody.cs new file mode 100644 index 00000000..52189e9b --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/Item/WithNamePatchRequestBody.cs @@ -0,0 +1,63 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Variables.Item { + public class WithNamePatchRequestBody : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the variable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The value of the variable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WithNamePatchRequestBody() { + 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 WithNamePatchRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WithNamePatchRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"name", n => { Name = n.GetStringValue(); } }, + {"value", n => { Value = 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("name", Name); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesGetResponse.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesGetResponse.cs new file mode 100644 index 00000000..6b3d4885 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesGetResponse.cs @@ -0,0 +1,58 @@ +// +using GitHub.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Variables { + public class VariablesGetResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The total_count property + public int? TotalCount { get; set; } + /// The variables property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Variables { get; set; } +#nullable restore +#else + public List Variables { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VariablesGetResponse() { + 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 VariablesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VariablesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"total_count", n => { TotalCount = n.GetIntValue(); } }, + {"variables", n => { Variables = n.GetCollectionOfObjectValues(ActionsVariable.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// 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.WriteIntValue("total_count", TotalCount); + writer.WriteCollectionOfObjectValues("variables", Variables); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesPostRequestBody.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesPostRequestBody.cs new file mode 100644 index 00000000..5bb78ad2 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Variables { + public class VariablesPostRequestBody : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the variable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The value of the variable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VariablesPostRequestBody() { + 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 VariablesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VariablesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"name", n => { Name = n.GetStringValue(); } }, + {"value", n => { Value = 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("name", Name); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesRequestBuilder.cs new file mode 100644 index 00000000..4f0e7169 --- /dev/null +++ b/src/GitHub/Repos/Item/Item/Environments/Item/Variables/VariablesRequestBuilder.cs @@ -0,0 +1,132 @@ +// +using GitHub.Models; +using GitHub.Repos.Item.Item.Environments.Item.Variables.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace GitHub.Repos.Item.Item.Environments.Item.Variables { + /// + /// Builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables + /// + public class VariablesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the GitHub.repos.item.item.environments.item.variables.item collection + /// The name of the variable. + /// A + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(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 VariablesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables{?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 VariablesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables{?page*,per_page*}", rawUrl) { + } + /// + /// Lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` 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, VariablesGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// API method documentation + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(VariablesPostRequestBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(VariablesPostRequestBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, EmptyObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` 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; + } + /// + /// Create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(VariablesPostRequestBody body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(VariablesPostRequestBody body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables", 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 VariablesRequestBuilder WithUrl(string rawUrl) { + return new VariablesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + public class VariablesRequestBuilderGetQueryParameters { + /// 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 30). 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; } + } + } +} diff --git a/src/GitHub/Repos/Item/Item/Environments/Item/WithEnvironment_nameItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Environments/Item/WithEnvironment_nameItemRequestBuilder.cs index c1216d1e..7407ac1e 100644 --- a/src/GitHub/Repos/Item/Item/Environments/Item/WithEnvironment_nameItemRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Environments/Item/WithEnvironment_nameItemRequestBuilder.cs @@ -2,6 +2,8 @@ using GitHub.Models; using GitHub.Repos.Item.Item.Environments.Item.DeploymentBranchPolicies; using GitHub.Repos.Item.Item.Environments.Item.Deployment_protection_rules; +using GitHub.Repos.Item.Item.Environments.Item.Secrets; +using GitHub.Repos.Item.Item.Environments.Item.Variables; using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; @@ -23,6 +25,14 @@ public class WithEnvironment_nameItemRequestBuilder : BaseRequestBuilder { public DeploymentBranchPoliciesRequestBuilder DeploymentBranchPolicies { get => new DeploymentBranchPoliciesRequestBuilder(PathParameters, RequestAdapter); } + /// The secrets property + public SecretsRequestBuilder Secrets { get => + new SecretsRequestBuilder(PathParameters, RequestAdapter); + } + /// The variables property + public VariablesRequestBuilder Variables { get => + new VariablesRequestBuilder(PathParameters, RequestAdapter); + } /// /// Instantiates a new and sets the default values. /// diff --git a/src/GitHub/Repos/Item/Item/Git/MatchingRefs/MatchingRefsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Git/MatchingRefs/MatchingRefsRequestBuilder.cs index 25767c4f..be4cd5d6 100644 --- a/src/GitHub/Repos/Item/Item/Git/MatchingRefs/MatchingRefsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Git/MatchingRefs/MatchingRefsRequestBuilder.cs @@ -12,7 +12,7 @@ namespace GitHub.Repos.Item.Item.Git.MatchingRefs { /// public class MatchingRefsRequestBuilder : BaseRequestBuilder { /// Gets an item from the GitHub.repos.item.item.git.matchingRefs.item collection - /// Unique identifier of the item + /// The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. /// A public WithRefItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); diff --git a/src/GitHub/Repos/Item/Item/Git/Ref/RefRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Git/Ref/RefRequestBuilder.cs index 99f60f24..331ff146 100644 --- a/src/GitHub/Repos/Item/Item/Git/Ref/RefRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Git/Ref/RefRequestBuilder.cs @@ -12,7 +12,7 @@ namespace GitHub.Repos.Item.Item.Git.Ref { /// public class RefRequestBuilder : BaseRequestBuilder { /// Gets an item from the GitHub.repos.item.item.git.ref.item collection - /// Unique identifier of the item + /// The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. /// A public WithRefItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); diff --git a/src/GitHub/Repos/Item/Item/Git/Refs/Item/WithRefItemRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Git/Refs/Item/WithRefItemRequestBuilder.cs index 9baf0a80..23ca85ab 100644 --- a/src/GitHub/Repos/Item/Item/Git/Refs/Item/WithRefItemRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Git/Refs/Item/WithRefItemRequestBuilder.cs @@ -28,7 +28,7 @@ public class WithRefItemRequestBuilder : BaseRequestBuilder { public WithRefItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/refs/{ref}", rawUrl) { } /// - /// Delete a reference + /// Deletes the provided reference. /// API method documentation /// /// Cancellation token to use when cancelling requests @@ -48,7 +48,7 @@ public class WithRefItemRequestBuilder : BaseRequestBuilder { await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// - /// Update a reference + /// Updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. /// API method documentation /// /// A @@ -70,6 +70,9 @@ public class WithRefItemRequestBuilder : BaseRequestBuilder { }; return await RequestAdapter.SendAsync(requestInfo, GitRef.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } + /// + /// Deletes the provided reference. + /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -84,6 +87,9 @@ public class WithRefItemRequestBuilder : BaseRequestBuilder { requestInfo.Headers.TryAdd("Accept", "application/json"); return requestInfo; } + /// + /// Updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// /// A /// The request body /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/GitHub/Repos/Item/Item/Git/Refs/RefsRequestBuilder.cs b/src/GitHub/Repos/Item/Item/Git/Refs/RefsRequestBuilder.cs index ebb3276b..6b5b8a8c 100644 --- a/src/GitHub/Repos/Item/Item/Git/Refs/RefsRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/Git/Refs/RefsRequestBuilder.cs @@ -15,7 +15,7 @@ namespace GitHub.Repos.Item.Item.Git.Refs { /// public class RefsRequestBuilder : BaseRequestBuilder { /// Gets an item from the GitHub.repos.item.item.git.refs.item collection - /// The name of the reference to update (for example, `heads/featureA`). Can be a branch name (`heads/BRANCH_NAME`) or tag name (`tags/TAG_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. /// A public WithRefItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); diff --git a/src/GitHub/Repositories/RepositoriesRequestBuilder.cs b/src/GitHub/Repositories/RepositoriesRequestBuilder.cs index f7022e2e..d19f692a 100644 --- a/src/GitHub/Repositories/RepositoriesRequestBuilder.cs +++ b/src/GitHub/Repositories/RepositoriesRequestBuilder.cs @@ -1,6 +1,5 @@ // using GitHub.Models; -using GitHub.Repositories.Item; using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Abstractions; using System.Collections.Generic; @@ -14,14 +13,6 @@ namespace GitHub.Repositories { /// Builds and executes requests for operations under \repositories /// public class RepositoriesRequestBuilder : BaseRequestBuilder { - /// Gets an item from the GitHub.repositories.item collection - /// The unique identifier of the repository. - /// A - public WithRepository_ItemRequestBuilder this[int position] { get { - var urlTplParams = new Dictionary(PathParameters); - urlTplParams.Add("repository_id", position); - return new WithRepository_ItemRequestBuilder(urlTplParams, RequestAdapter); - } } /// /// Instantiates a new and sets the default values. /// diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 96e5476e..189505bb 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "8972B77B95704170D9F0484AF18AF0A61D49C58B6549AE22A3797042A1CAB79646A14C5F8877A33DFCFBF9039B4F9CAEE2BF593D5A956DDD4DD452F749497FBE", + "descriptionHash": "728430A700C1A6B37AA3A767B0FDF1A6C56A311E37615AFFFF2E17557A73D3F2F98242BE97554E6D7667A9E748060FC914162082ADE8B04924A1DB371FC1F8B9", "descriptionLocation": "../../../source-generator/schemas/downloaded.json", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.12.0-preview.202402290001", + "kiotaVersion": "1.12.0-preview.202403040006", "clientClassName": "GitHubClient", "clientNamespaceName": "GitHub", "language": "CSharp",