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

updates for error mapping #498

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 1 addition & 1 deletion msgraph-mail/dotnet/Models/Microsoft/Graph/Attachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Attachment : Entity, IParsable {
public bool? IsInline { get; set; }
/// <summary>The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z</summary>
public DateTimeOffset? LastModifiedDateTime { get; set; }
/// <summary>The attachment's file name.</summary>
/// <summary>The display name of the attachment. This does not need to be the actual file name.</summary>
public string Name { get; set; }
/// <summary>The length of the attachment in bytes.</summary>
public int? Size { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace Graphdotnetv4.Models.Microsoft.Graph {
public class DateTimeTimeZone : 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>A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000).</summary>
/// <summary>A single point of time in a combined date and time representation ({date}T{time}). For example, '2019-04-16T09:00:00'.</summary>
public string DateTime { get; set; }
/// <summary>Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values.</summary>
/// <summary>Represents a time zone, for example, 'Pacific Standard Time'. See below for possible values.</summary>
public string TimeZone { get; set; }
/// <summary>
/// Instantiates a new dateTimeTimeZone and sets the default values.
Expand Down
4 changes: 2 additions & 2 deletions msgraph-mail/dotnet/Models/Microsoft/Graph/EmailAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace Graphdotnetv4.Models.Microsoft.Graph {
public class EmailAddress : 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>The email address of the person or entity.</summary>
/// <summary>The email address of an entity instance.</summary>
public string Address { get; set; }
/// <summary>The display name of the person or entity.</summary>
/// <summary>The display name of an entity instance.</summary>
public string Name { get; set; }
/// <summary>
/// Instantiates a new emailAddress and sets the default values.
Expand Down
2 changes: 1 addition & 1 deletion msgraph-mail/dotnet/Models/Microsoft/Graph/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Message : OutlookItem, IParsable {
/// <summary>The Bcc: recipients for the message.</summary>
public List<Recipient> BccRecipients { get; set; }
public ItemBody Body { get; set; }
/// <summary>The first 255 characters of the message body. It is in text format.</summary>
/// <summary>The first 255 characters of the message body. It is in text format. If the message contains instances of mention, this property would contain a concatenation of these mentions as well.</summary>
public string BodyPreview { get; set; }
/// <summary>The Cc: recipients for the message.</summary>
public List<Recipient> CcRecipients { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class MessageRuleActions : IParsable {
public string MoveToFolder { get; set; }
/// <summary>Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder.</summary>
public bool? PermanentDelete { get; set; }
/// <summary>The email addresses to which a message should be redirected.</summary>
/// <summary>The email address to which a message should be redirected.</summary>
public List<Recipient> RedirectTo { get; set; }
/// <summary>Indicates whether subsequent rules should be evaluated.</summary>
public bool? StopProcessingRules { get; set; }
Expand Down
41 changes: 41 additions & 0 deletions msgraph-mail/dotnet/Models/Odata/Error/Detail.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Microsoft.Kiota.Abstractions.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Graphdotnetv4.Models.Odata.Error {
public class Detail : 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; }
public string Code { get; set; }
public string Message { get; set; }
public string Target { get; set; }
/// <summary>
/// Instantiates a new detail and sets the default values.
/// </summary>
public Detail() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<T, IParseNode>> GetFieldDeserializers<T>() {
return new Dictionary<string, Action<T, IParseNode>> {
{"code", (o,n) => { (o as Detail).Code = n.GetStringValue(); } },
{"message", (o,n) => { (o as Detail).Message = n.GetStringValue(); } },
{"target", (o,n) => { (o as Detail).Target = n.GetStringValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// <param name="writer">Serialization writer to use to serialize this model</param>
/// </summary>
public void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("code", Code);
writer.WriteStringValue("message", Message);
writer.WriteStringValue("target", Target);
writer.WriteAdditionalData(AdditionalData);
}
}
}
36 changes: 36 additions & 0 deletions msgraph-mail/dotnet/Models/Odata/Error/Error.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Abstractions.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Graphdotnetv4.Models.Odata.Error {
public class Error : ApiException, 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; }
public Main Error_prop { get; set; }
/// <summary>
/// Instantiates a new Error and sets the default values.
/// </summary>
public Error() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<T, IParseNode>> GetFieldDeserializers<T>() {
return new Dictionary<string, Action<T, IParseNode>> {
{"error", (o,n) => { (o as Error).Error_prop = n.GetObjectValue<Main>(); } },
};
}
/// <summary>
/// Serializes information the current object
/// <param name="writer">Serialization writer to use to serialize this model</param>
/// </summary>
public void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<Main>("error", Error_prop);
writer.WriteAdditionalData(AdditionalData);
}
}
}
35 changes: 35 additions & 0 deletions msgraph-mail/dotnet/Models/Odata/Error/Innererror.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Microsoft.Kiota.Abstractions.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Graphdotnetv4.Models.Odata.Error {
public class Innererror : 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; }
public string Code { get; set; }
/// <summary>
/// Instantiates a new innererror and sets the default values.
/// </summary>
public Innererror() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<T, IParseNode>> GetFieldDeserializers<T>() {
return new Dictionary<string, Action<T, IParseNode>> {
{"code", (o,n) => { (o as Innererror).Code = n.GetStringValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// <param name="writer">Serialization writer to use to serialize this model</param>
/// </summary>
public void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("code", Code);
writer.WriteAdditionalData(AdditionalData);
}
}
}
48 changes: 48 additions & 0 deletions msgraph-mail/dotnet/Models/Odata/Error/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Microsoft.Kiota.Abstractions.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Graphdotnetv4.Models.Odata.Error {
public class Main : 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; }
public string Code { get; set; }
public List<Detail> Details { get; set; }
/// <summary>The structure of this object is service-specific</summary>
public Innererror Innererror { get; set; }
public string Message { get; set; }
public string Target { get; set; }
/// <summary>
/// Instantiates a new main and sets the default values.
/// </summary>
public Main() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
public IDictionary<string, Action<T, IParseNode>> GetFieldDeserializers<T>() {
return new Dictionary<string, Action<T, IParseNode>> {
{"code", (o,n) => { (o as Main).Code = n.GetStringValue(); } },
{"details", (o,n) => { (o as Main).Details = n.GetCollectionOfObjectValues<Detail>().ToList(); } },
{"innererror", (o,n) => { (o as Main).Innererror = n.GetObjectValue<Innererror>(); } },
{"message", (o,n) => { (o as Main).Message = n.GetStringValue(); } },
{"target", (o,n) => { (o as Main).Target = n.GetStringValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// <param name="writer">Serialization writer to use to serialize this model</param>
/// </summary>
public void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("code", Code);
writer.WriteCollectionOfObjectValues<Detail>("details", Details);
writer.WriteObjectValue<Innererror>("innererror", Innererror);
writer.WriteStringValue("message", Message);
writer.WriteStringValue("target", Target);
writer.WriteAdditionalData(AdditionalData);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Graphdotnetv4.Models.Microsoft.Graph;
using Graphdotnetv4.Models.Odata.Error;
using Graphdotnetv4.Users.Item.InferenceClassification.Overrides;
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Abstractions.Serialization;
Expand Down Expand Up @@ -110,7 +111,10 @@ public RequestInformation CreatePatchRequestInformation(Graphdotnetv4.Models.Mic
/// </summary>
public async Task DeleteAsync(Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
var requestInfo = CreateDeleteRequestInformation(h, o);
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>
/// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance.
Expand All @@ -122,7 +126,10 @@ public async Task DeleteAsync(Action<IDictionary<string, string>> h = default, I
/// </summary>
public async Task<Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification> GetAsync(Action<GetQueryParameters> q = default, Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
var requestInfo = CreateGetRequestInformation(q, h, o);
return await RequestAdapter.SendAsync<Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification>(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
return await RequestAdapter.SendAsync<Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification>(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>
/// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance.
Expand All @@ -135,7 +142,10 @@ public async Task DeleteAsync(Action<IDictionary<string, string>> h = default, I
public async Task PatchAsync(Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification body, Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = CreatePatchRequestInformation(body, h, o);
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance.</summary>
public class GetQueryParameters : QueryParametersBase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Graphdotnetv4.Models.Microsoft.Graph;
using Graphdotnetv4.Models.Odata.Error;
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Abstractions.Serialization;
using System;
Expand Down Expand Up @@ -106,7 +107,10 @@ public RequestInformation CreatePatchRequestInformation(InferenceClassificationO
/// </summary>
public async Task DeleteAsync(Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
var requestInfo = CreateDeleteRequestInformation(h, o);
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>
/// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable.
Expand All @@ -118,7 +122,10 @@ public async Task DeleteAsync(Action<IDictionary<string, string>> h = default, I
/// </summary>
public async Task<InferenceClassificationOverride> GetAsync(Action<GetQueryParameters> q = default, Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
var requestInfo = CreateGetRequestInformation(q, h, o);
return await RequestAdapter.SendAsync<InferenceClassificationOverride>(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
return await RequestAdapter.SendAsync<InferenceClassificationOverride>(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>
/// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable.
Expand All @@ -131,7 +138,10 @@ public async Task<InferenceClassificationOverride> GetAsync(Action<GetQueryParam
public async Task PatchAsync(InferenceClassificationOverride body, Action<IDictionary<string, string>> h = default, IEnumerable<IRequestOption> o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) {
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = CreatePatchRequestInformation(body, h, o);
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken);
var errorMapping = new Dictionary<string, Func<IParsable>> {
{"4XX", () => new Error()},
};
await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, errorMapping, cancellationToken);
}
/// <summary>A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable.</summary>
public class GetQueryParameters : QueryParametersBase {
Expand Down
Loading