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

feat: Code formatting and model changes #72

Merged
merged 1 commit into from
May 20, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions src/GitHub.Octokit.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.8.4" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.1.6" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.2.3" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.9.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.1" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.2.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.3.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.1.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.1.5" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.2.0" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.1.5" />
<None Include="NugetREADME.md" Pack="true" PackagePath="\" />
<None Include="octokit.png" Pack="true" PackagePath="\" />
Expand Down
9 changes: 5 additions & 4 deletions src/GitHub/Advisories/AdvisoriesRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.Advisories {
namespace GitHub.Advisories
{
/// <summary>
/// Builds and executes requests for operations under \advisories
/// </summary>
public class AdvisoriesRequestBuilder : BaseRequestBuilder
public class AdvisoriesRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the GitHub.advisories.item collection</summary>
/// <param name="position">The GHSA (GitHub Security Advisory) identifier of the advisory.</param>
Expand Down Expand Up @@ -64,8 +65,8 @@ public async Task<List<GlobalAdvisory>> GetAsync(Action<RequestConfiguration<Adv
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"422", ValidationErrorSimple.CreateFromDiscriminatorValue},
{"429", BasicError.CreateFromDiscriminatorValue},
{ "422", ValidationErrorSimple.CreateFromDiscriminatorValue },
{ "429", BasicError.CreateFromDiscriminatorValue },
};
var collectionResult = await RequestAdapter.SendCollectionAsync<GlobalAdvisory>(requestInfo, GlobalAdvisory.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.ToList();
Expand Down
3 changes: 2 additions & 1 deletion src/GitHub/Advisories/GetDirectionQueryParameterType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Advisories {
namespace GitHub.Advisories
{
#pragma warning disable CS1591
public enum GetDirectionQueryParameterType
#pragma warning restore CS1591
Expand Down
3 changes: 2 additions & 1 deletion src/GitHub/Advisories/GetSeverityQueryParameterType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Advisories {
namespace GitHub.Advisories
{
#pragma warning disable CS1591
public enum GetSeverityQueryParameterType
#pragma warning restore CS1591
Expand Down
3 changes: 2 additions & 1 deletion src/GitHub/Advisories/GetSortQueryParameterType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Advisories {
namespace GitHub.Advisories
{
#pragma warning disable CS1591
public enum GetSortQueryParameterType
#pragma warning restore CS1591
Expand Down
3 changes: 2 additions & 1 deletion src/GitHub/Advisories/GetTypeQueryParameterType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Advisories {
namespace GitHub.Advisories
{
#pragma warning disable CS1591
public enum GetTypeQueryParameterType
#pragma warning restore CS1591
Expand Down
7 changes: 4 additions & 3 deletions src/GitHub/Advisories/Item/WithGhsa_ItemRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.Advisories.Item {
namespace GitHub.Advisories.Item
{
/// <summary>
/// Builds and executes requests for operations under \advisories\{ghsa_id}
/// </summary>
public class WithGhsa_ItemRequestBuilder : BaseRequestBuilder
public class WithGhsa_ItemRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="WithGhsa_ItemRequestBuilder"/> and sets the default values.
Expand Down Expand Up @@ -50,7 +51,7 @@ public async Task<GlobalAdvisory> GetAsync(Action<RequestConfiguration<DefaultQu
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"404", BasicError.CreateFromDiscriminatorValue},
{ "404", BasicError.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<GlobalAdvisory>(requestInfo, GlobalAdvisory.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
5 changes: 3 additions & 2 deletions src/GitHub/App/AppRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App {
namespace GitHub.App
{
/// <summary>
/// Builds and executes requests for operations under \app
/// </summary>
public class AppRequestBuilder : BaseRequestBuilder
public class AppRequestBuilder : BaseRequestBuilder
{
/// <summary>The hook property</summary>
public HookRequestBuilder Hook
Expand Down
13 changes: 7 additions & 6 deletions src/GitHub/App/Hook/Config/ConfigPatchRequestBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
using System.IO;
using System.Linq;
using System;
namespace GitHub.App.Hook.Config {
namespace GitHub.App.Hook.Config
{
#pragma warning disable CS1591
public class ConfigPatchRequestBody : IAdditionalDataHolder, IParsable
public class ConfigPatchRequestBody : 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>
Expand Down Expand Up @@ -69,10 +70,10 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"content_type", n => { ContentType = n.GetStringValue(); } },
{"insecure_ssl", n => { InsecureSsl = n.GetObjectValue<WebhookConfigInsecureSsl>(WebhookConfigInsecureSsl.CreateFromDiscriminatorValue); } },
{"secret", n => { Secret = n.GetStringValue(); } },
{"url", n => { Url = n.GetStringValue(); } },
{ "content_type", n => { ContentType = n.GetStringValue(); } },
{ "insecure_ssl", n => { InsecureSsl = n.GetObjectValue<WebhookConfigInsecureSsl>(WebhookConfigInsecureSsl.CreateFromDiscriminatorValue); } },
{ "secret", n => { Secret = n.GetStringValue(); } },
{ "url", n => { Url = n.GetStringValue(); } },
};
}
/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/GitHub/App/Hook/Config/ConfigRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Hook.Config {
namespace GitHub.App.Hook.Config
{
/// <summary>
/// Builds and executes requests for operations under \app\hook\config
/// </summary>
public class ConfigRequestBuilder : BaseRequestBuilder
public class ConfigRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="ConfigRequestBuilder"/> and sets the default values.
Expand Down
9 changes: 5 additions & 4 deletions src/GitHub/App/Hook/Deliveries/DeliveriesRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Hook.Deliveries {
namespace GitHub.App.Hook.Deliveries
{
/// <summary>
/// Builds and executes requests for operations under \app\hook\deliveries
/// </summary>
public class DeliveriesRequestBuilder : BaseRequestBuilder
public class DeliveriesRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the GitHub.app.hook.deliveries.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
Expand Down Expand Up @@ -64,8 +65,8 @@ public async Task<List<HookDeliveryItem>> GetAsync(Action<RequestConfiguration<D
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"400", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
{ "400", BasicError.CreateFromDiscriminatorValue },
{ "422", ValidationError.CreateFromDiscriminatorValue },
};
var collectionResult = await RequestAdapter.SendCollectionAsync<HookDeliveryItem>(requestInfo, HookDeliveryItem.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using System.IO;
using System.Linq;
using System;
namespace GitHub.App.Hook.Deliveries.Item.Attempts {
namespace GitHub.App.Hook.Deliveries.Item.Attempts
{
#pragma warning disable CS1591
public class AttemptsPostResponse : IAdditionalDataHolder, IParsable
public class AttemptsPostResponse : 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Hook.Deliveries.Item.Attempts {
namespace GitHub.App.Hook.Deliveries.Item.Attempts
{
/// <summary>
/// Builds and executes requests for operations under \app\hook\deliveries\{delivery_id}\attempts
/// </summary>
public class AttemptsRequestBuilder : BaseRequestBuilder
public class AttemptsRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="AttemptsRequestBuilder"/> and sets the default values.
Expand Down Expand Up @@ -51,8 +52,8 @@ public async Task<AttemptsPostResponse> PostAsync(Action<RequestConfiguration<De
var requestInfo = ToPostRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"400", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
{ "400", BasicError.CreateFromDiscriminatorValue },
{ "422", ValidationError.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<AttemptsPostResponse>(requestInfo, AttemptsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Hook.Deliveries.Item {
namespace GitHub.App.Hook.Deliveries.Item
{
/// <summary>
/// Builds and executes requests for operations under \app\hook\deliveries\{delivery_id}
/// </summary>
public class WithDelivery_ItemRequestBuilder : BaseRequestBuilder
public class WithDelivery_ItemRequestBuilder : BaseRequestBuilder
{
/// <summary>The attempts property</summary>
public AttemptsRequestBuilder Attempts
Expand Down Expand Up @@ -57,8 +58,8 @@ public async Task<HookDelivery> GetAsync(Action<RequestConfiguration<DefaultQuer
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"400", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
{ "400", BasicError.CreateFromDiscriminatorValue },
{ "422", ValidationError.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<HookDelivery>(requestInfo, HookDelivery.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
5 changes: 3 additions & 2 deletions src/GitHub/App/Hook/HookRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
using System.Linq;
using System.Threading.Tasks;
using System;
namespace GitHub.App.Hook {
namespace GitHub.App.Hook
{
/// <summary>
/// Builds and executes requests for operations under \app\hook
/// </summary>
public class HookRequestBuilder : BaseRequestBuilder
public class HookRequestBuilder : BaseRequestBuilder
{
/// <summary>The config property</summary>
public ConfigRequestBuilder Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.InstallationRequests {
namespace GitHub.App.InstallationRequests
{
/// <summary>
/// Builds and executes requests for operations under \app\installation-requests
/// </summary>
public class InstallationRequestsRequestBuilder : BaseRequestBuilder
public class InstallationRequestsRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="InstallationRequestsRequestBuilder"/> and sets the default values.
Expand Down Expand Up @@ -50,7 +51,7 @@ public async Task<List<IntegrationInstallationRequest>> GetAsync(Action<RequestC
var requestInfo = ToGetRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"401", BasicError.CreateFromDiscriminatorValue},
{ "401", BasicError.CreateFromDiscriminatorValue },
};
var collectionResult = await RequestAdapter.SendCollectionAsync<IntegrationInstallationRequest>(requestInfo, IntegrationInstallationRequest.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.ToList();
Expand Down
5 changes: 3 additions & 2 deletions src/GitHub/App/Installations/InstallationsRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Installations {
namespace GitHub.App.Installations
{
/// <summary>
/// Builds and executes requests for operations under \app\installations
/// </summary>
public class InstallationsRequestBuilder : BaseRequestBuilder
public class InstallationsRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the GitHub.app.installations.item collection</summary>
/// <param name="position">The unique identifier of the installation.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
using System.IO;
using System.Linq;
using System;
namespace GitHub.App.Installations.Item.Access_tokens {
namespace GitHub.App.Installations.Item.Access_tokens
{
#pragma warning disable CS1591
public class Access_tokensPostRequestBody : IAdditionalDataHolder, IParsable
public class Access_tokensPostRequestBody : 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>
Expand Down Expand Up @@ -61,9 +62,9 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"permissions", n => { Permissions = n.GetObjectValue<AppPermissions>(AppPermissions.CreateFromDiscriminatorValue); } },
{"repositories", n => { Repositories = n.GetCollectionOfPrimitiveValues<string>()?.ToList(); } },
{"repository_ids", n => { RepositoryIds = n.GetCollectionOfPrimitiveValues<int?>()?.ToList(); } },
{ "permissions", n => { Permissions = n.GetObjectValue<AppPermissions>(AppPermissions.CreateFromDiscriminatorValue); } },
{ "repositories", n => { Repositories = n.GetCollectionOfPrimitiveValues<string>()?.ToList(); } },
{ "repository_ids", n => { RepositoryIds = n.GetCollectionOfPrimitiveValues<int?>()?.ToList(); } },
};
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Installations.Item.Access_tokens {
namespace GitHub.App.Installations.Item.Access_tokens
{
/// <summary>
/// Builds and executes requests for operations under \app\installations\{installation_id}\access_tokens
/// </summary>
public class Access_tokensRequestBuilder : BaseRequestBuilder
public class Access_tokensRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="Access_tokensRequestBuilder"/> and sets the default values.
Expand Down Expand Up @@ -55,10 +56,10 @@ public async Task<InstallationToken> PostAsync(Access_tokensPostRequestBody body
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"401", BasicError.CreateFromDiscriminatorValue},
{"403", BasicError.CreateFromDiscriminatorValue},
{"404", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
{ "401", BasicError.CreateFromDiscriminatorValue },
{ "403", BasicError.CreateFromDiscriminatorValue },
{ "404", BasicError.CreateFromDiscriminatorValue },
{ "422", ValidationError.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<InstallationToken>(requestInfo, InstallationToken.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
using System.Threading.Tasks;
using System.Threading;
using System;
namespace GitHub.App.Installations.Item.Suspended {
namespace GitHub.App.Installations.Item.Suspended
{
/// <summary>
/// Builds and executes requests for operations under \app\installations\{installation_id}\suspended
/// </summary>
public class SuspendedRequestBuilder : BaseRequestBuilder
public class SuspendedRequestBuilder : BaseRequestBuilder
{
/// <summary>
/// Instantiates a new <see cref="SuspendedRequestBuilder"/> and sets the default values.
Expand Down Expand Up @@ -49,7 +50,7 @@ public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters
var requestInfo = ToDeleteRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"404", BasicError.CreateFromDiscriminatorValue},
{ "404", BasicError.CreateFromDiscriminatorValue },
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand All @@ -72,7 +73,7 @@ public async Task PutAsync(Action<RequestConfiguration<DefaultQueryParameters>>
var requestInfo = ToPutRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"404", BasicError.CreateFromDiscriminatorValue},
{ "404", BasicError.CreateFromDiscriminatorValue },
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
Loading
Loading