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

breaking change: docs [ * ], Organization [Remove 422 HTTP error response], Project Card [Removes 422 error response] #35

Merged
merged 4 commits into from
Feb 1, 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
4 changes: 2 additions & 2 deletions src/GitHub/Apps/Item/WithApp_slugItemRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WithApp_slugItemRequestBuilder(Dictionary<string, object> pathParameters,
public WithApp_slugItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/apps/{app_slug}", rawUrl) {
}
/// <summary>
/// **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.
/// **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) of the target app to access this endpoint.
/// API method documentation <see href="https://docs.github.com/rest/apps/apps#get-an-app" />
/// </summary>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand All @@ -48,7 +48,7 @@ public async Task<Integration> GetAsync(Action<RequestConfiguration<DefaultQuery
return await RequestAdapter.SendAsync<Integration>(requestInfo, Integration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.
/// **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) of the target app to access this endpoint.
/// </summary>
/// <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
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Models/OrgCustomProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace GitHub.Models {
public class OrgCustomProperty : IAdditionalDataHolder, IParsable {
/// <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>Ordered list of allowed values of the property</summary>
/// <summary>An ordered list of the allowed values of the property.The property can have up to 200 allowed values.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<string>? AllowedValues { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace GitHub.Orgs.Item.Properties.Schema.Item {
public class WithCustom_property_namePutRequestBody : IAdditionalDataHolder, IParsable {
/// <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>Ordered list of allowed values of the property</summary>
/// <summary>An ordered list of the allowed values of the property.The property can have up to 200 allowed values.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<string>? AllowedValues { get; set; }
Expand Down
63 changes: 0 additions & 63 deletions src/GitHub/Orgs/Item/WithOrgItemRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public async Task<OrganizationFull> PatchAsync(WithOrgPatchRequestBody body, Act
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
{"409", BasicError.CreateFromDiscriminatorValue},
{"422", OrganizationFull422Error.CreateFromDiscriminatorValue},
};
return await RequestAdapter.SendAsync<OrganizationFull>(requestInfo, OrganizationFull.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down Expand Up @@ -324,67 +323,5 @@ public RequestInformation ToPatchRequestInformation(WithOrgPatchRequestBody body
public WithOrgItemRequestBuilder WithUrl(string rawUrl) {
return new WithOrgItemRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// Composed type wrapper for classes validationError, validationErrorSimple
/// </summary>
public class OrganizationFull422Error : IComposedTypeWrapper, IParsable {
/// <summary>Composed type representation for type validationError</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public GitHub.Models.ValidationError? ValidationError { get; set; }
#nullable restore
#else
public GitHub.Models.ValidationError ValidationError { get; set; }
#endif
/// <summary>Composed type representation for type validationErrorSimple</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public GitHub.Models.ValidationErrorSimple? ValidationErrorSimple { get; set; }
#nullable restore
#else
public GitHub.Models.ValidationErrorSimple ValidationErrorSimple { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static OrganizationFull422Error CreateFromDiscriminatorValue(IParseNode parseNode) {
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new OrganizationFull422Error();
if("validation-error".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.ValidationError = new GitHub.Models.ValidationError();
}
else if("validation-error-simple".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.ValidationErrorSimple = new GitHub.Models.ValidationErrorSimple();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
if(ValidationError != null) {
return ValidationError.GetFieldDeserializers();
}
else if(ValidationErrorSimple != null) {
return ValidationErrorSimple.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <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));
if(ValidationError != null) {
writer.WriteObjectValue<GitHub.Models.ValidationError>(null, ValidationError);
}
else if(ValidationErrorSimple != null) {
writer.WriteObjectValue<GitHub.Models.ValidationErrorSimple>(null, ValidationErrorSimple);
}
}
}
}
}
63 changes: 0 additions & 63 deletions src/GitHub/Projects/Columns/Item/Cards/CardsRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public async Task<ProjectCard> PostAsync(CardsPostRequestBody body, Action<Reque
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
{"401", BasicError.CreateFromDiscriminatorValue},
{"403", BasicError.CreateFromDiscriminatorValue},
{"422", ProjectCard422Error.CreateFromDiscriminatorValue},
{"503", ProjectCard503Error.CreateFromDiscriminatorValue},
};
return await RequestAdapter.SendAsync<ProjectCard>(requestInfo, ProjectCard.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -221,67 +220,5 @@ public class CardsRequestBuilderGetQueryParameters {
[QueryParameter("per_page")]
public int? PerPage { get; set; }
}
/// <summary>
/// Composed type wrapper for classes validationError, validationErrorSimple
/// </summary>
public class ProjectCard422Error : IComposedTypeWrapper, IParsable {
/// <summary>Composed type representation for type validationError</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public GitHub.Models.ValidationError? ValidationError { get; set; }
#nullable restore
#else
public GitHub.Models.ValidationError ValidationError { get; set; }
#endif
/// <summary>Composed type representation for type validationErrorSimple</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public GitHub.Models.ValidationErrorSimple? ValidationErrorSimple { get; set; }
#nullable restore
#else
public GitHub.Models.ValidationErrorSimple ValidationErrorSimple { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static ProjectCard422Error CreateFromDiscriminatorValue(IParseNode parseNode) {
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new ProjectCard422Error();
if("validation-error".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.ValidationError = new GitHub.Models.ValidationError();
}
else if("validation-error-simple".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.ValidationErrorSimple = new GitHub.Models.ValidationErrorSimple();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
if(ValidationError != null) {
return ValidationError.GetFieldDeserializers();
}
else if(ValidationErrorSimple != null) {
return ValidationErrorSimple.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <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));
if(ValidationError != null) {
writer.WriteObjectValue<GitHub.Models.ValidationError>(null, ValidationError);
}
else if(ValidationErrorSimple != null) {
writer.WriteObjectValue<GitHub.Models.ValidationErrorSimple>(null, ValidationErrorSimple);
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/GitHub/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "4449867C0AC3A828B10145F6C6448E06F07D21ED915DE8096A543CC1BF0DE5C221C239CAD7AC221971CEF6175B8EAD84908133AF15F9EB354A89900301CF0B52",
"descriptionHash": "63C5AFA3CB55443DD281C336A5928AD5485BC8FB359294E40326F6F7DC5A98A241BB0B702DB86F62ECA1A4FAE72F1BCECC959F78905104D9C8018906CEC8F763",
"descriptionLocation": "../../../source-generator/schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.10.1",
"kiotaVersion": "1.11.0-preview.202401300001",
"clientClassName": "GitHubClient",
"clientNamespaceName": "GitHub",
"language": "CSharp",
Expand Down
Loading