- fixes date time property type generation

This commit is contained in:
Vincent Biret 2021-04-20 14:05:39 -04:00
Родитель 869c7b71db
Коммит 4c08b58636
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 32426322EDFFB7E3
9 изменённых файлов: 48 добавлений и 45 удалений

Просмотреть файл

@ -9,7 +9,7 @@ namespace Graphdotnetv4.Users {
/// <summary>true if the attachment is an inline attachment; otherwise, false.</summary>
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 string LastModifiedDateTime { get; set; }
public DateTimeOffset? LastModifiedDateTime { get; set; }
/// <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>
@ -23,7 +23,7 @@ namespace Graphdotnetv4.Users {
"isInline", (o,n) => { o.IsInline = n.GetBoolValue(); }
},
{
"lastModifiedDateTime", (o,n) => { o.LastModifiedDateTime = n.GetStringValue(); }
"lastModifiedDateTime", (o,n) => { o.LastModifiedDateTime = n.GetDateTimeOffsetValue(); }
},
{
"name", (o,n) => { o.Name = n.GetStringValue(); }
@ -40,7 +40,7 @@ namespace Graphdotnetv4.Users {
base.Serialize(writer);
writer.WriteStringValue("contentType", ContentType);
writer.WriteBoolValue("isInline", IsInline);
writer.WriteStringValue("lastModifiedDateTime", LastModifiedDateTime);
writer.WriteDateTimeOffsetValue("lastModifiedDateTime", LastModifiedDateTime);
writer.WriteStringValue("name", Name);
writer.WriteIntValue("size", Size);
}

Просмотреть файл

@ -36,12 +36,12 @@ namespace Graphdotnetv4.Users {
/// <summary>The unique identifier for the message's parent mailFolder.</summary>
public string ParentFolderId { get; set; }
/// <summary>The date and time the message was received. The date and time information uses 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 string ReceivedDateTime { get; set; }
public DateTimeOffset? ReceivedDateTime { get; set; }
/// <summary>The email addresses to use when replying.</summary>
public List<Recipient> ReplyTo { get; set; }
public Recipient Sender { get; set; }
/// <summary>The date and time the message was sent. The date and time information uses 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 string SentDateTime { get; set; }
public DateTimeOffset? SentDateTime { get; set; }
/// <summary>The subject of the message.</summary>
public string Subject { get; set; }
/// <summary>The To: recipients for the message.</summary>
@ -114,7 +114,7 @@ namespace Graphdotnetv4.Users {
"parentFolderId", (o,n) => { o.ParentFolderId = n.GetStringValue(); }
},
{
"receivedDateTime", (o,n) => { o.ReceivedDateTime = n.GetStringValue(); }
"receivedDateTime", (o,n) => { o.ReceivedDateTime = n.GetDateTimeOffsetValue(); }
},
{
"replyTo", (o,n) => { o.ReplyTo = n.GetCollectionOfObjectValues<Recipient>().ToList(); }
@ -123,7 +123,7 @@ namespace Graphdotnetv4.Users {
"sender", (o,n) => { o.Sender = n.GetObjectValue<Recipient>(); }
},
{
"sentDateTime", (o,n) => { o.SentDateTime = n.GetStringValue(); }
"sentDateTime", (o,n) => { o.SentDateTime = n.GetDateTimeOffsetValue(); }
},
{
"subject", (o,n) => { o.Subject = n.GetStringValue(); }
@ -174,10 +174,10 @@ namespace Graphdotnetv4.Users {
writer.WriteBoolValue("isRead", IsRead);
writer.WriteBoolValue("isReadReceiptRequested", IsReadReceiptRequested);
writer.WriteStringValue("parentFolderId", ParentFolderId);
writer.WriteStringValue("receivedDateTime", ReceivedDateTime);
writer.WriteDateTimeOffsetValue("receivedDateTime", ReceivedDateTime);
writer.WriteCollectionOfObjectValues<Recipient>("replyTo", ReplyTo);
writer.WriteObjectValue<Recipient>("sender", Sender);
writer.WriteStringValue("sentDateTime", SentDateTime);
writer.WriteDateTimeOffsetValue("sentDateTime", SentDateTime);
writer.WriteStringValue("subject", Subject);
writer.WriteCollectionOfObjectValues<Recipient>("toRecipients", ToRecipients);
writer.WriteObjectValue<ItemBody>("uniqueBody", UniqueBody);

Просмотреть файл

@ -9,9 +9,9 @@ namespace Graphdotnetv4.Users {
/// <summary>Identifies the version of the item. Every time the item is changed, changeKey changes as well. This allows Exchange to apply changes to the correct version of the object. Read-only.</summary>
public string ChangeKey { 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 string CreatedDateTime { get; set; }
public DateTimeOffset? CreatedDateTime { 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 string LastModifiedDateTime { get; set; }
public DateTimeOffset? LastModifiedDateTime { get; set; }
/// <summary>The serialization information for the current model</summary>
public new IDictionary<string, Action<OutlookItem, IParseNode>> DeserializeFields => new Dictionary<string, Action<OutlookItem, IParseNode>> {
{
@ -21,10 +21,10 @@ namespace Graphdotnetv4.Users {
"changeKey", (o,n) => { o.ChangeKey = n.GetStringValue(); }
},
{
"createdDateTime", (o,n) => { o.CreatedDateTime = n.GetStringValue(); }
"createdDateTime", (o,n) => { o.CreatedDateTime = n.GetDateTimeOffsetValue(); }
},
{
"lastModifiedDateTime", (o,n) => { o.LastModifiedDateTime = n.GetStringValue(); }
"lastModifiedDateTime", (o,n) => { o.LastModifiedDateTime = n.GetDateTimeOffsetValue(); }
},
};
/// <summary>
@ -35,8 +35,8 @@ namespace Graphdotnetv4.Users {
base.Serialize(writer);
writer.WriteCollectionOfPrimitiveValues<string>("categories", Categories);
writer.WriteStringValue("changeKey", ChangeKey);
writer.WriteStringValue("createdDateTime", CreatedDateTime);
writer.WriteStringValue("lastModifiedDateTime", LastModifiedDateTime);
writer.WriteDateTimeOffsetValue("createdDateTime", CreatedDateTime);
writer.WriteDateTimeOffsetValue("lastModifiedDateTime", LastModifiedDateTime);
}
}
}

Просмотреть файл

@ -3,6 +3,7 @@ package graphjavav4.utilities.users;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
import java.util.function.BiConsumer;
import java.util.HashMap;
import java.util.Map;
@ -16,7 +17,7 @@ public class Attachment extends Entity implements Parsable {
public Boolean isInline;
/** 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 */
@javax.annotation.Nullable
public String lastModifiedDateTime;
public OffsetDateTime lastModifiedDateTime;
/** The display name of the attachment. This does not need to be the actual file name. */
@javax.annotation.Nullable
public String name;
@ -33,7 +34,7 @@ public class Attachment extends Entity implements Parsable {
super.serialize(writer);
writer.writeStringValue("contentType", contentType);
writer.writeBooleanValue("isInline", isInline);
writer.writeStringValue("lastModifiedDateTime", lastModifiedDateTime);
writer.writeOffsetDateTimeValue("lastModifiedDateTime", lastModifiedDateTime);
writer.writeStringValue("name", name);
writer.writeIntegerValue("size", size);
}
@ -46,7 +47,7 @@ public class Attachment extends Entity implements Parsable {
final Map<String, BiConsumer<T, ParseNode>> fields = new HashMap<>(super.getDeserializeFields());
fields.put("contentType", (o, n) -> { ((Attachment)o).contentType = n.getStringValue(); });
fields.put("isInline", (o, n) -> { ((Attachment)o).isInline = n.getBooleanValue(); });
fields.put("lastModifiedDateTime", (o, n) -> { ((Attachment)o).lastModifiedDateTime = n.getStringValue(); });
fields.put("lastModifiedDateTime", (o, n) -> { ((Attachment)o).lastModifiedDateTime = n.getOffsetDateTimeValue(); });
fields.put("name", (o, n) -> { ((Attachment)o).name = n.getStringValue(); });
fields.put("size", (o, n) -> { ((Attachment)o).size = n.getIntegerValue(); });
return fields;

Просмотреть файл

@ -3,6 +3,7 @@ package graphjavav4.utilities.users;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
import java.util.function.BiConsumer;
import java.util.HashMap;
import java.util.List;
@ -60,7 +61,7 @@ public class Message extends OutlookItem implements Parsable {
public String parentFolderId;
/** The date and time the message was received. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. */
@javax.annotation.Nullable
public String receivedDateTime;
public OffsetDateTime receivedDateTime;
/** The email addresses to use when replying. */
@javax.annotation.Nullable
public List<Recipient> replyTo;
@ -68,7 +69,7 @@ public class Message extends OutlookItem implements Parsable {
public Recipient sender;
/** The date and time the message was sent. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. */
@javax.annotation.Nullable
public String sentDateTime;
public OffsetDateTime sentDateTime;
/** The subject of the message. */
@javax.annotation.Nullable
public String subject;
@ -118,10 +119,10 @@ public class Message extends OutlookItem implements Parsable {
writer.writeBooleanValue("isRead", isRead);
writer.writeBooleanValue("isReadReceiptRequested", isReadReceiptRequested);
writer.writeStringValue("parentFolderId", parentFolderId);
writer.writeStringValue("receivedDateTime", receivedDateTime);
writer.writeOffsetDateTimeValue("receivedDateTime", receivedDateTime);
writer.writeCollectionOfObjectValues("replyTo", replyTo);
writer.writeObjectValue("sender", sender);
writer.writeStringValue("sentDateTime", sentDateTime);
writer.writeOffsetDateTimeValue("sentDateTime", sentDateTime);
writer.writeStringValue("subject", subject);
writer.writeCollectionOfObjectValues("toRecipients", toRecipients);
writer.writeObjectValue("uniqueBody", uniqueBody);
@ -156,10 +157,10 @@ public class Message extends OutlookItem implements Parsable {
fields.put("isRead", (o, n) -> { ((Message)o).isRead = n.getBooleanValue(); });
fields.put("isReadReceiptRequested", (o, n) -> { ((Message)o).isReadReceiptRequested = n.getBooleanValue(); });
fields.put("parentFolderId", (o, n) -> { ((Message)o).parentFolderId = n.getStringValue(); });
fields.put("receivedDateTime", (o, n) -> { ((Message)o).receivedDateTime = n.getStringValue(); });
fields.put("receivedDateTime", (o, n) -> { ((Message)o).receivedDateTime = n.getOffsetDateTimeValue(); });
fields.put("replyTo", (o, n) -> { ((Message)o).replyTo = n.getCollectionOfObjectValues(Recipient.class); });
fields.put("sender", (o, n) -> { ((Message)o).sender = n.getObjectValue(Recipient.class); });
fields.put("sentDateTime", (o, n) -> { ((Message)o).sentDateTime = n.getStringValue(); });
fields.put("sentDateTime", (o, n) -> { ((Message)o).sentDateTime = n.getOffsetDateTimeValue(); });
fields.put("subject", (o, n) -> { ((Message)o).subject = n.getStringValue(); });
fields.put("toRecipients", (o, n) -> { ((Message)o).toRecipients = n.getCollectionOfObjectValues(Recipient.class); });
fields.put("uniqueBody", (o, n) -> { ((Message)o).uniqueBody = n.getObjectValue(ItemBody.class); });

Просмотреть файл

@ -3,6 +3,7 @@ package graphjavav4.utilities.users;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
import java.util.function.BiConsumer;
import java.util.HashMap;
import java.util.List;
@ -17,10 +18,10 @@ public class OutlookItem extends Entity implements Parsable {
public String changeKey;
/** 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 */
@javax.annotation.Nullable
public String createdDateTime;
public OffsetDateTime createdDateTime;
/** 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 */
@javax.annotation.Nullable
public String lastModifiedDateTime;
public OffsetDateTime lastModifiedDateTime;
/**
* Serialiazes information the current object
* @param writer Serialization writer to use to serialize this model
@ -31,8 +32,8 @@ public class OutlookItem extends Entity implements Parsable {
super.serialize(writer);
writer.writeCollectionOfPrimitiveValues("categories", categories);
writer.writeStringValue("changeKey", changeKey);
writer.writeStringValue("createdDateTime", createdDateTime);
writer.writeStringValue("lastModifiedDateTime", lastModifiedDateTime);
writer.writeOffsetDateTimeValue("createdDateTime", createdDateTime);
writer.writeOffsetDateTimeValue("lastModifiedDateTime", lastModifiedDateTime);
}
/**
* The serialization information for the current model
@ -43,8 +44,8 @@ public class OutlookItem extends Entity implements Parsable {
final Map<String, BiConsumer<T, ParseNode>> fields = new HashMap<>(super.getDeserializeFields());
fields.put("categories", (o, n) -> { ((OutlookItem)o).categories = n.getCollectionOfPrimitiveValues(String.class); });
fields.put("changeKey", (o, n) -> { ((OutlookItem)o).changeKey = n.getStringValue(); });
fields.put("createdDateTime", (o, n) -> { ((OutlookItem)o).createdDateTime = n.getStringValue(); });
fields.put("lastModifiedDateTime", (o, n) -> { ((OutlookItem)o).lastModifiedDateTime = n.getStringValue(); });
fields.put("createdDateTime", (o, n) -> { ((OutlookItem)o).createdDateTime = n.getOffsetDateTimeValue(); });
fields.put("lastModifiedDateTime", (o, n) -> { ((OutlookItem)o).lastModifiedDateTime = n.getOffsetDateTimeValue(); });
return fields;
}
}

Просмотреть файл

@ -7,7 +7,7 @@ export class Attachment extends Entity implements Parsable<Attachment> {
/** true if the attachment is an inline attachment; otherwise, false. */
public isInline?: boolean | undefined;
/** 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 */
public lastModifiedDateTime?: string | undefined;
public lastModifiedDateTime?: Date | undefined;
/** The display name of the attachment. This does not need to be the actual file name. */
public name?: string | undefined;
/** The length of the attachment in bytes. */
@ -21,7 +21,7 @@ export class Attachment extends Entity implements Parsable<Attachment> {
super.serialize(writer);
writer.writeStringValue("contentType", this.contentType);
writer.writeBooleanValue("isInline", this.isInline);
writer.writeStringValue("lastModifiedDateTime", this.lastModifiedDateTime);
writer.writeDateValue("lastModifiedDateTime", this.lastModifiedDateTime);
writer.writeStringValue("name", this.name);
writer.writeNumberValue("size", this.size);
};
@ -33,7 +33,7 @@ export class Attachment extends Entity implements Parsable<Attachment> {
return new Map<string, (item: Attachment, node: ParseNode) => void>([...super.deserializeFields(),
["contentType", (o, n) => { o.contentType = n.getStringValue(); }],
["isInline", (o, n) => { o.isInline = n.getBooleanValue(); }],
["lastModifiedDateTime", (o, n) => { o.lastModifiedDateTime = n.getStringValue(); }],
["lastModifiedDateTime", (o, n) => { o.lastModifiedDateTime = n.getDateValue(); }],
["name", (o, n) => { o.name = n.getStringValue(); }],
["size", (o, n) => { o.size = n.getNumberValue(); }],
]);

Просмотреть файл

@ -44,12 +44,12 @@ export class Message extends OutlookItem implements Parsable<Message> {
/** The unique identifier for the message's parent mailFolder. */
public parentFolderId?: string | undefined;
/** The date and time the message was received. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. */
public receivedDateTime?: string | undefined;
public receivedDateTime?: Date | undefined;
/** The email addresses to use when replying. */
public replyTo?: Recipient[] | undefined;
public sender?: Recipient | undefined;
/** The date and time the message was sent. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. */
public sentDateTime?: string | undefined;
public sentDateTime?: Date | undefined;
/** The subject of the message. */
public subject?: string | undefined;
/** The To: recipients for the message. */
@ -90,10 +90,10 @@ export class Message extends OutlookItem implements Parsable<Message> {
writer.writeBooleanValue("isRead", this.isRead);
writer.writeBooleanValue("isReadReceiptRequested", this.isReadReceiptRequested);
writer.writeStringValue("parentFolderId", this.parentFolderId);
writer.writeStringValue("receivedDateTime", this.receivedDateTime);
writer.writeDateValue("receivedDateTime", this.receivedDateTime);
writer.writeCollectionOfObjectValues<Recipient>("replyTo", this.replyTo);
writer.writeObjectValue<Recipient>("sender", this.sender);
writer.writeStringValue("sentDateTime", this.sentDateTime);
writer.writeDateValue("sentDateTime", this.sentDateTime);
writer.writeStringValue("subject", this.subject);
writer.writeCollectionOfObjectValues<Recipient>("toRecipients", this.toRecipients);
writer.writeObjectValue<ItemBody>("uniqueBody", this.uniqueBody);
@ -127,10 +127,10 @@ export class Message extends OutlookItem implements Parsable<Message> {
["isRead", (o, n) => { o.isRead = n.getBooleanValue(); }],
["isReadReceiptRequested", (o, n) => { o.isReadReceiptRequested = n.getBooleanValue(); }],
["parentFolderId", (o, n) => { o.parentFolderId = n.getStringValue(); }],
["receivedDateTime", (o, n) => { o.receivedDateTime = n.getStringValue(); }],
["receivedDateTime", (o, n) => { o.receivedDateTime = n.getDateValue(); }],
["replyTo", (o, n) => { o.replyTo = n.getCollectionOfObjectValues<Recipient>(Recipient); }],
["sender", (o, n) => { o.sender = n.getObjectValue<Recipient>(Recipient); }],
["sentDateTime", (o, n) => { o.sentDateTime = n.getStringValue(); }],
["sentDateTime", (o, n) => { o.sentDateTime = n.getDateValue(); }],
["subject", (o, n) => { o.subject = n.getStringValue(); }],
["toRecipients", (o, n) => { o.toRecipients = n.getCollectionOfObjectValues<Recipient>(Recipient); }],
["uniqueBody", (o, n) => { o.uniqueBody = n.getObjectValue<ItemBody>(ItemBody); }],

Просмотреть файл

@ -7,9 +7,9 @@ export class OutlookItem extends Entity implements Parsable<OutlookItem> {
/** Identifies the version of the item. Every time the item is changed, changeKey changes as well. This allows Exchange to apply changes to the correct version of the object. Read-only. */
public changeKey?: string | undefined;
/** 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 */
public createdDateTime?: string | undefined;
public createdDateTime?: Date | undefined;
/** 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 */
public lastModifiedDateTime?: string | undefined;
public lastModifiedDateTime?: Date | undefined;
/**
* Serialiazes information the current object
* @param writer Serialization writer to use to serialize this model
@ -19,8 +19,8 @@ export class OutlookItem extends Entity implements Parsable<OutlookItem> {
super.serialize(writer);
writer.writeCollectionOfPrimitiveValues<string>("categories", this.categories);
writer.writeStringValue("changeKey", this.changeKey);
writer.writeStringValue("createdDateTime", this.createdDateTime);
writer.writeStringValue("lastModifiedDateTime", this.lastModifiedDateTime);
writer.writeDateValue("createdDateTime", this.createdDateTime);
writer.writeDateValue("lastModifiedDateTime", this.lastModifiedDateTime);
};
/**
* The serialization information for the current model
@ -30,8 +30,8 @@ export class OutlookItem extends Entity implements Parsable<OutlookItem> {
return new Map<string, (item: OutlookItem, node: ParseNode) => void>([...super.deserializeFields(),
["categories", (o, n) => { o.categories = n.getCollectionOfPrimitiveValues<string>(); }],
["changeKey", (o, n) => { o.changeKey = n.getStringValue(); }],
["createdDateTime", (o, n) => { o.createdDateTime = n.getStringValue(); }],
["lastModifiedDateTime", (o, n) => { o.lastModifiedDateTime = n.getStringValue(); }],
["createdDateTime", (o, n) => { o.createdDateTime = n.getDateValue(); }],
["lastModifiedDateTime", (o, n) => { o.lastModifiedDateTime = n.getDateValue(); }],
]);
};
}