-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
...dency-injection/GitHub/Repos/Item/Item/Releases/Item/WithReleaseNameItemRequestBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// <auto-generated/> | ||
using GitHub.ApiClient.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.ApiClient.Repos.Item.Item.Releases.Item | ||
{ | ||
/// <summary> | ||
/// Builds and executes requests for operations under \repos\{owner}\{repo}\releases\{releaseName} | ||
/// </summary> | ||
public class WithReleaseNameItemRequestBuilder : BaseRequestBuilder | ||
{ | ||
/// <summary> | ||
/// Instantiates a new <see cref="GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder"/> 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 WithReleaseNameItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner}/{repo}/releases/{releaseName}", pathParameters) | ||
{ | ||
} | ||
/// <summary> | ||
/// Instantiates a new <see cref="GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder"/> 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 WithReleaseNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner}/{repo}/releases/{releaseName}", rawUrl) | ||
{ | ||
} | ||
/// <summary> | ||
/// Get the latest release | ||
/// </summary> | ||
/// <returns>A <see cref="GitHub.ApiClient.Models.Release"/></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> | ||
/// <exception cref="GitHub.ApiClient.Models.Error">When receiving a 404 status code</exception> | ||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER | ||
#nullable enable | ||
public async Task<GitHub.ApiClient.Models.Release?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#nullable restore | ||
#else | ||
public async Task<GitHub.ApiClient.Models.Release> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#endif | ||
var requestInfo = ToGetRequestInformation(requestConfiguration); | ||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> | ||
{ | ||
{ "404", GitHub.ApiClient.Models.Error.CreateFromDiscriminatorValue }, | ||
}; | ||
return await RequestAdapter.SendAsync<GitHub.ApiClient.Models.Release>(requestInfo, GitHub.ApiClient.Models.Release.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); | ||
} | ||
/// <summary> | ||
/// Get the latest release | ||
/// </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="GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder"/></returns> | ||
/// <param name="rawUrl">The raw URL to use for the request builder.</param> | ||
public GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder WithUrl(string rawUrl) | ||
{ | ||
return new GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder(rawUrl, RequestAdapter); | ||
} | ||
/// <summary> | ||
/// Configuration for the request such as headers, query parameters, and middleware options. | ||
/// </summary> | ||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] | ||
public class WithReleaseNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters> | ||
{ | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...ted/dotnet-dependency-injection/GitHub/Repos/Item/Item/Releases/ReleasesRequestBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// <auto-generated/> | ||
using GitHub.ApiClient.Repos.Item.Item.Releases.Item; | ||
using Microsoft.Kiota.Abstractions; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System; | ||
namespace GitHub.ApiClient.Repos.Item.Item.Releases | ||
{ | ||
/// <summary> | ||
/// Builds and executes requests for operations under \repos\{owner}\{repo}\releases | ||
/// </summary> | ||
public class ReleasesRequestBuilder : BaseRequestBuilder | ||
{ | ||
/// <summary>Gets an item from the GitHub.ApiClient.repos.item.item.releases.item collection</summary> | ||
/// <param name="position">The name of the release</param> | ||
/// <returns>A <see cref="GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder"/></returns> | ||
public GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder this[string position] | ||
{ | ||
get | ||
{ | ||
var urlTplParams = new Dictionary<string, object>(PathParameters); | ||
urlTplParams.Add("releaseName", position); | ||
return new GitHub.ApiClient.Repos.Item.Item.Releases.Item.WithReleaseNameItemRequestBuilder(urlTplParams, RequestAdapter); | ||
} | ||
} | ||
/// <summary> | ||
/// Instantiates a new <see cref="GitHub.ApiClient.Repos.Item.Item.Releases.ReleasesRequestBuilder"/> 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 ReleasesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner}/{repo}/releases", pathParameters) | ||
{ | ||
} | ||
/// <summary> | ||
/// Instantiates a new <see cref="GitHub.ApiClient.Repos.Item.Item.Releases.ReleasesRequestBuilder"/> 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 ReleasesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/repos/{owner}/{repo}/releases", rawUrl) | ||
{ | ||
} | ||
} | ||
} |