diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/Attachment.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/Attachment.cs index 0455a517d..78edd1ac4 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/Attachment.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/Attachment.cs @@ -16,6 +16,14 @@ public class Attachment : Entity, IParsable { /// The length of the attachment in bytes. public int? Size { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new Attachment CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Attachment(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/DateTimeTimeZone.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/DateTimeTimeZone.cs index 6d427a752..6bc0e876e 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/DateTimeTimeZone.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/DateTimeTimeZone.cs @@ -18,6 +18,14 @@ public DateTimeTimeZone() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static DateTimeTimeZone CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DateTimeTimeZone(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/EmailAddress.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/EmailAddress.cs index a8a3d24de..61f4e23f9 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/EmailAddress.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/EmailAddress.cs @@ -18,6 +18,14 @@ public EmailAddress() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static EmailAddress CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmailAddress(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/Entity.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/Entity.cs index 5131d9190..024ee6dc2 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/Entity.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/Entity.cs @@ -16,6 +16,14 @@ public Entity() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Entity(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/Extension.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/Extension.cs index a5ee7bfe2..3703e40bc 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/Extension.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/Extension.cs @@ -5,6 +5,14 @@ using System.Linq; namespace Graphdotnetv4.Models.Microsoft.Graph { public class Extension : Entity, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new Extension CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Extension(); + } /// /// The deserialization information for the current model /// diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/FollowupFlag.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/FollowupFlag.cs index 17db6bc34..75fee16a4 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/FollowupFlag.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/FollowupFlag.cs @@ -18,14 +18,22 @@ public FollowupFlag() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static FollowupFlag CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FollowupFlag(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"completedDateTime", (o,n) => { (o as FollowupFlag).CompletedDateTime = n.GetObjectValue(); } }, - {"dueDateTime", (o,n) => { (o as FollowupFlag).DueDateTime = n.GetObjectValue(); } }, + {"completedDateTime", (o,n) => { (o as FollowupFlag).CompletedDateTime = n.GetObjectValue(DateTimeTimeZone.CreateFromDiscriminatorValue); } }, + {"dueDateTime", (o,n) => { (o as FollowupFlag).DueDateTime = n.GetObjectValue(DateTimeTimeZone.CreateFromDiscriminatorValue); } }, {"flagStatus", (o,n) => { (o as FollowupFlag).FlagStatus = n.GetEnumValue(); } }, - {"startDateTime", (o,n) => { (o as FollowupFlag).StartDateTime = n.GetObjectValue(); } }, + {"startDateTime", (o,n) => { (o as FollowupFlag).StartDateTime = n.GetObjectValue(DateTimeTimeZone.CreateFromDiscriminatorValue); } }, }; } /// diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassification.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassification.cs index 4d7e551ba..f3d49c680 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassification.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassification.cs @@ -8,11 +8,19 @@ public class InferenceClassification : Entity, IParsable { /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. public List Overrides { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new InferenceClassification CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InferenceClassification(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"overrides", (o,n) => { (o as InferenceClassification).Overrides = n.GetCollectionOfObjectValues().ToList(); } }, + {"overrides", (o,n) => { (o as InferenceClassification).Overrides = n.GetCollectionOfObjectValues(InferenceClassificationOverride.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassificationOverride.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassificationOverride.cs index 4c2948294..2871e7229 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassificationOverride.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/InferenceClassificationOverride.cs @@ -8,12 +8,20 @@ public class InferenceClassificationOverride : Entity, IParsable { public InferenceClassificationType? ClassifyAs { get; set; } public EmailAddress SenderEmailAddress { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new InferenceClassificationOverride CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InferenceClassificationOverride(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"classifyAs", (o,n) => { (o as InferenceClassificationOverride).ClassifyAs = n.GetEnumValue(); } }, - {"senderEmailAddress", (o,n) => { (o as InferenceClassificationOverride).SenderEmailAddress = n.GetObjectValue(); } }, + {"senderEmailAddress", (o,n) => { (o as InferenceClassificationOverride).SenderEmailAddress = n.GetObjectValue(EmailAddress.CreateFromDiscriminatorValue); } }, }; } /// diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/InternetMessageHeader.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/InternetMessageHeader.cs index 782a351c9..6f874c03f 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/InternetMessageHeader.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/InternetMessageHeader.cs @@ -18,6 +18,14 @@ public InternetMessageHeader() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static InternetMessageHeader CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InternetMessageHeader(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/ItemBody.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/ItemBody.cs index ce1b09009..b8f430b1a 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/ItemBody.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/ItemBody.cs @@ -17,6 +17,14 @@ public ItemBody() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static ItemBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ItemBody(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/MailFolder.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/MailFolder.cs index 21d3ccd59..369092359 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/MailFolder.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/MailFolder.cs @@ -28,19 +28,27 @@ public class MailFolder : Entity, IParsable { /// The number of items in the mailFolder marked as unread. public int? UnreadItemCount { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new MailFolder CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MailFolder(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { {"childFolderCount", (o,n) => { (o as MailFolder).ChildFolderCount = n.GetIntValue(); } }, - {"childFolders", (o,n) => { (o as MailFolder).ChildFolders = n.GetCollectionOfObjectValues().ToList(); } }, + {"childFolders", (o,n) => { (o as MailFolder).ChildFolders = n.GetCollectionOfObjectValues(MailFolder.CreateFromDiscriminatorValue).ToList(); } }, {"displayName", (o,n) => { (o as MailFolder).DisplayName = n.GetStringValue(); } }, {"isHidden", (o,n) => { (o as MailFolder).IsHidden = n.GetBoolValue(); } }, - {"messageRules", (o,n) => { (o as MailFolder).MessageRules = n.GetCollectionOfObjectValues().ToList(); } }, - {"messages", (o,n) => { (o as MailFolder).Messages = n.GetCollectionOfObjectValues().ToList(); } }, - {"multiValueExtendedProperties", (o,n) => { (o as MailFolder).MultiValueExtendedProperties = n.GetCollectionOfObjectValues().ToList(); } }, + {"messageRules", (o,n) => { (o as MailFolder).MessageRules = n.GetCollectionOfObjectValues(MessageRule.CreateFromDiscriminatorValue).ToList(); } }, + {"messages", (o,n) => { (o as MailFolder).Messages = n.GetCollectionOfObjectValues(Message.CreateFromDiscriminatorValue).ToList(); } }, + {"multiValueExtendedProperties", (o,n) => { (o as MailFolder).MultiValueExtendedProperties = n.GetCollectionOfObjectValues(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, {"parentFolderId", (o,n) => { (o as MailFolder).ParentFolderId = n.GetStringValue(); } }, - {"singleValueExtendedProperties", (o,n) => { (o as MailFolder).SingleValueExtendedProperties = n.GetCollectionOfObjectValues().ToList(); } }, + {"singleValueExtendedProperties", (o,n) => { (o as MailFolder).SingleValueExtendedProperties = n.GetCollectionOfObjectValues(SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, {"totalItemCount", (o,n) => { (o as MailFolder).TotalItemCount = n.GetIntValue(); } }, {"unreadItemCount", (o,n) => { (o as MailFolder).UnreadItemCount = n.GetIntValue(); } }, }; diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/Message.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/Message.cs index 923dd103b..65e979cc8 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/Message.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/Message.cs @@ -24,7 +24,7 @@ public class Message : OutlookItem, IParsable { public Recipient From { get; set; } /// Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . public bool? HasAttachments { get; set; } - public Importance? Importance { get; set; } + public Graphdotnetv4.Models.Microsoft.Graph.Importance? Importance { get; set; } public InferenceClassificationType? InferenceClassification { get; set; } public List InternetMessageHeaders { get; set; } public string InternetMessageId { get; set; } @@ -46,39 +46,47 @@ public class Message : OutlookItem, IParsable { public ItemBody UniqueBody { get; set; } public string WebLink { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new Message CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Message(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attachments", (o,n) => { (o as Message).Attachments = n.GetCollectionOfObjectValues().ToList(); } }, - {"bccRecipients", (o,n) => { (o as Message).BccRecipients = n.GetCollectionOfObjectValues().ToList(); } }, - {"body", (o,n) => { (o as Message).Body = n.GetObjectValue(); } }, + {"attachments", (o,n) => { (o as Message).Attachments = n.GetCollectionOfObjectValues(Attachment.CreateFromDiscriminatorValue).ToList(); } }, + {"bccRecipients", (o,n) => { (o as Message).BccRecipients = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, + {"body", (o,n) => { (o as Message).Body = n.GetObjectValue(ItemBody.CreateFromDiscriminatorValue); } }, {"bodyPreview", (o,n) => { (o as Message).BodyPreview = n.GetStringValue(); } }, - {"ccRecipients", (o,n) => { (o as Message).CcRecipients = n.GetCollectionOfObjectValues().ToList(); } }, + {"ccRecipients", (o,n) => { (o as Message).CcRecipients = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, {"conversationId", (o,n) => { (o as Message).ConversationId = n.GetStringValue(); } }, {"conversationIndex", (o,n) => { (o as Message).ConversationIndex = n.GetByteArrayValue(); } }, - {"extensions", (o,n) => { (o as Message).Extensions = n.GetCollectionOfObjectValues().ToList(); } }, - {"flag", (o,n) => { (o as Message).Flag = n.GetObjectValue(); } }, - {"from", (o,n) => { (o as Message).From = n.GetObjectValue(); } }, + {"extensions", (o,n) => { (o as Message).Extensions = n.GetCollectionOfObjectValues(Extension.CreateFromDiscriminatorValue).ToList(); } }, + {"flag", (o,n) => { (o as Message).Flag = n.GetObjectValue(FollowupFlag.CreateFromDiscriminatorValue); } }, + {"from", (o,n) => { (o as Message).From = n.GetObjectValue(Recipient.CreateFromDiscriminatorValue); } }, {"hasAttachments", (o,n) => { (o as Message).HasAttachments = n.GetBoolValue(); } }, {"importance", (o,n) => { (o as Message).Importance = n.GetEnumValue(); } }, {"inferenceClassification", (o,n) => { (o as Message).InferenceClassification = n.GetEnumValue(); } }, - {"internetMessageHeaders", (o,n) => { (o as Message).InternetMessageHeaders = n.GetCollectionOfObjectValues().ToList(); } }, + {"internetMessageHeaders", (o,n) => { (o as Message).InternetMessageHeaders = n.GetCollectionOfObjectValues(InternetMessageHeader.CreateFromDiscriminatorValue).ToList(); } }, {"internetMessageId", (o,n) => { (o as Message).InternetMessageId = n.GetStringValue(); } }, {"isDeliveryReceiptRequested", (o,n) => { (o as Message).IsDeliveryReceiptRequested = n.GetBoolValue(); } }, {"isDraft", (o,n) => { (o as Message).IsDraft = n.GetBoolValue(); } }, {"isRead", (o,n) => { (o as Message).IsRead = n.GetBoolValue(); } }, {"isReadReceiptRequested", (o,n) => { (o as Message).IsReadReceiptRequested = n.GetBoolValue(); } }, - {"multiValueExtendedProperties", (o,n) => { (o as Message).MultiValueExtendedProperties = n.GetCollectionOfObjectValues().ToList(); } }, + {"multiValueExtendedProperties", (o,n) => { (o as Message).MultiValueExtendedProperties = n.GetCollectionOfObjectValues(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, {"parentFolderId", (o,n) => { (o as Message).ParentFolderId = n.GetStringValue(); } }, {"receivedDateTime", (o,n) => { (o as Message).ReceivedDateTime = n.GetDateTimeOffsetValue(); } }, - {"replyTo", (o,n) => { (o as Message).ReplyTo = n.GetCollectionOfObjectValues().ToList(); } }, - {"sender", (o,n) => { (o as Message).Sender = n.GetObjectValue(); } }, + {"replyTo", (o,n) => { (o as Message).ReplyTo = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, + {"sender", (o,n) => { (o as Message).Sender = n.GetObjectValue(Recipient.CreateFromDiscriminatorValue); } }, {"sentDateTime", (o,n) => { (o as Message).SentDateTime = n.GetDateTimeOffsetValue(); } }, - {"singleValueExtendedProperties", (o,n) => { (o as Message).SingleValueExtendedProperties = n.GetCollectionOfObjectValues().ToList(); } }, + {"singleValueExtendedProperties", (o,n) => { (o as Message).SingleValueExtendedProperties = n.GetCollectionOfObjectValues(SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, {"subject", (o,n) => { (o as Message).Subject = n.GetStringValue(); } }, - {"toRecipients", (o,n) => { (o as Message).ToRecipients = n.GetCollectionOfObjectValues().ToList(); } }, - {"uniqueBody", (o,n) => { (o as Message).UniqueBody = n.GetObjectValue(); } }, + {"toRecipients", (o,n) => { (o as Message).ToRecipients = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, + {"uniqueBody", (o,n) => { (o as Message).UniqueBody = n.GetObjectValue(ItemBody.CreateFromDiscriminatorValue); } }, {"webLink", (o,n) => { (o as Message).WebLink = n.GetStringValue(); } }, }; } diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRule.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRule.cs index 4ab66a692..3ec693584 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRule.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRule.cs @@ -19,14 +19,22 @@ public class MessageRule : Entity, IParsable { /// Indicates the order in which the rule is executed, among other rules. public int? Sequence { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new MessageRule CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageRule(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"actions", (o,n) => { (o as MessageRule).Actions = n.GetObjectValue(); } }, - {"conditions", (o,n) => { (o as MessageRule).Conditions = n.GetObjectValue(); } }, + {"actions", (o,n) => { (o as MessageRule).Actions = n.GetObjectValue(MessageRuleActions.CreateFromDiscriminatorValue); } }, + {"conditions", (o,n) => { (o as MessageRule).Conditions = n.GetObjectValue(MessageRulePredicates.CreateFromDiscriminatorValue); } }, {"displayName", (o,n) => { (o as MessageRule).DisplayName = n.GetStringValue(); } }, - {"exceptions", (o,n) => { (o as MessageRule).Exceptions = n.GetObjectValue(); } }, + {"exceptions", (o,n) => { (o as MessageRule).Exceptions = n.GetObjectValue(MessageRulePredicates.CreateFromDiscriminatorValue); } }, {"hasError", (o,n) => { (o as MessageRule).HasError = n.GetBoolValue(); } }, {"isEnabled", (o,n) => { (o as MessageRule).IsEnabled = n.GetBoolValue(); } }, {"isReadOnly", (o,n) => { (o as MessageRule).IsReadOnly = n.GetBoolValue(); } }, diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRuleActions.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRuleActions.cs index b8f4342c2..d7bdede0c 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRuleActions.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRuleActions.cs @@ -35,6 +35,14 @@ public MessageRuleActions() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MessageRuleActions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageRuleActions(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { @@ -42,13 +50,13 @@ public IDictionary> GetFieldDeserializers() { {"assignCategories", (o,n) => { (o as MessageRuleActions).AssignCategories = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"copyToFolder", (o,n) => { (o as MessageRuleActions).CopyToFolder = n.GetStringValue(); } }, {"delete", (o,n) => { (o as MessageRuleActions).Delete = n.GetBoolValue(); } }, - {"forwardAsAttachmentTo", (o,n) => { (o as MessageRuleActions).ForwardAsAttachmentTo = n.GetCollectionOfObjectValues().ToList(); } }, - {"forwardTo", (o,n) => { (o as MessageRuleActions).ForwardTo = n.GetCollectionOfObjectValues().ToList(); } }, + {"forwardAsAttachmentTo", (o,n) => { (o as MessageRuleActions).ForwardAsAttachmentTo = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, + {"forwardTo", (o,n) => { (o as MessageRuleActions).ForwardTo = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, {"markAsRead", (o,n) => { (o as MessageRuleActions).MarkAsRead = n.GetBoolValue(); } }, {"markImportance", (o,n) => { (o as MessageRuleActions).MarkImportance = n.GetEnumValue(); } }, {"moveToFolder", (o,n) => { (o as MessageRuleActions).MoveToFolder = n.GetStringValue(); } }, {"permanentDelete", (o,n) => { (o as MessageRuleActions).PermanentDelete = n.GetBoolValue(); } }, - {"redirectTo", (o,n) => { (o as MessageRuleActions).RedirectTo = n.GetCollectionOfObjectValues().ToList(); } }, + {"redirectTo", (o,n) => { (o as MessageRuleActions).RedirectTo = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, {"stopProcessingRules", (o,n) => { (o as MessageRuleActions).StopProcessingRules = n.GetBoolValue(); } }, }; } diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRulePredicates.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRulePredicates.cs index 2387f3286..9a220f4aa 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRulePredicates.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/MessageRulePredicates.cs @@ -19,7 +19,7 @@ public class MessageRulePredicates : IParsable { public bool? HasAttachments { get; set; } /// Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. public List HeaderContains { get; set; } - public Importance? Importance { get; set; } + public Graphdotnetv4.Models.Microsoft.Graph.Importance? Importance { get; set; } /// Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. public bool? IsApprovalRequest { get; set; } /// Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. @@ -42,14 +42,14 @@ public class MessageRulePredicates : IParsable { public bool? IsSigned { get; set; } /// Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. public bool? IsVoicemail { get; set; } - public MessageActionFlag? MessageActionFlag { get; set; } + public Graphdotnetv4.Models.Microsoft.Graph.MessageActionFlag? MessageActionFlag { get; set; } /// Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. public bool? NotSentToMe { get; set; } /// Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. public List RecipientContains { get; set; } /// Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. public List SenderContains { get; set; } - public Sensitivity? Sensitivity { get; set; } + public Graphdotnetv4.Models.Microsoft.Graph.Sensitivity? Sensitivity { get; set; } /// Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. public bool? SentCcMe { get; set; } /// Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. @@ -70,6 +70,14 @@ public MessageRulePredicates() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MessageRulePredicates CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageRulePredicates(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { @@ -77,7 +85,7 @@ public IDictionary> GetFieldDeserializers() { {"bodyContains", (o,n) => { (o as MessageRulePredicates).BodyContains = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"bodyOrSubjectContains", (o,n) => { (o as MessageRulePredicates).BodyOrSubjectContains = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"categories", (o,n) => { (o as MessageRulePredicates).Categories = n.GetCollectionOfPrimitiveValues().ToList(); } }, - {"fromAddresses", (o,n) => { (o as MessageRulePredicates).FromAddresses = n.GetCollectionOfObjectValues().ToList(); } }, + {"fromAddresses", (o,n) => { (o as MessageRulePredicates).FromAddresses = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, {"hasAttachments", (o,n) => { (o as MessageRulePredicates).HasAttachments = n.GetBoolValue(); } }, {"headerContains", (o,n) => { (o as MessageRulePredicates).HeaderContains = n.GetCollectionOfPrimitiveValues().ToList(); } }, {"importance", (o,n) => { (o as MessageRulePredicates).Importance = n.GetEnumValue(); } }, @@ -99,11 +107,11 @@ public IDictionary> GetFieldDeserializers() { {"sensitivity", (o,n) => { (o as MessageRulePredicates).Sensitivity = n.GetEnumValue(); } }, {"sentCcMe", (o,n) => { (o as MessageRulePredicates).SentCcMe = n.GetBoolValue(); } }, {"sentOnlyToMe", (o,n) => { (o as MessageRulePredicates).SentOnlyToMe = n.GetBoolValue(); } }, - {"sentToAddresses", (o,n) => { (o as MessageRulePredicates).SentToAddresses = n.GetCollectionOfObjectValues().ToList(); } }, + {"sentToAddresses", (o,n) => { (o as MessageRulePredicates).SentToAddresses = n.GetCollectionOfObjectValues(Recipient.CreateFromDiscriminatorValue).ToList(); } }, {"sentToMe", (o,n) => { (o as MessageRulePredicates).SentToMe = n.GetBoolValue(); } }, {"sentToOrCcMe", (o,n) => { (o as MessageRulePredicates).SentToOrCcMe = n.GetBoolValue(); } }, {"subjectContains", (o,n) => { (o as MessageRulePredicates).SubjectContains = n.GetCollectionOfPrimitiveValues().ToList(); } }, - {"withinSizeRange", (o,n) => { (o as MessageRulePredicates).WithinSizeRange = n.GetObjectValue(); } }, + {"withinSizeRange", (o,n) => { (o as MessageRulePredicates).WithinSizeRange = n.GetObjectValue(SizeRange.CreateFromDiscriminatorValue); } }, }; } /// diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/MultiValueLegacyExtendedProperty.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/MultiValueLegacyExtendedProperty.cs index 3cc16ee36..5073821c8 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/MultiValueLegacyExtendedProperty.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/MultiValueLegacyExtendedProperty.cs @@ -8,6 +8,14 @@ public class MultiValueLegacyExtendedProperty : Entity, IParsable { /// A collection of property values. public List Value { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new MultiValueLegacyExtendedProperty CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MultiValueLegacyExtendedProperty(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/OutlookItem.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/OutlookItem.cs index 7106ff179..0bd68e191 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/OutlookItem.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/OutlookItem.cs @@ -14,6 +14,14 @@ public class OutlookItem : Entity, IParsable { /// 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 DateTimeOffset? LastModifiedDateTime { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new OutlookItem CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OutlookItem(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/Recipient.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/Recipient.cs index 72cbc3d79..29622fe3b 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/Recipient.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/Recipient.cs @@ -7,7 +7,7 @@ namespace Graphdotnetv4.Models.Microsoft.Graph { public class Recipient : IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - public EmailAddress EmailAddress { get; set; } + public Graphdotnetv4.Models.Microsoft.Graph.EmailAddress EmailAddress { get; set; } /// /// Instantiates a new recipient and sets the default values. /// @@ -15,11 +15,19 @@ public Recipient() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static Recipient CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Recipient(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"emailAddress", (o,n) => { (o as Recipient).EmailAddress = n.GetObjectValue(); } }, + {"emailAddress", (o,n) => { (o as Recipient).EmailAddress = n.GetObjectValue(Graphdotnetv4.Models.Microsoft.Graph.EmailAddress.CreateFromDiscriminatorValue); } }, }; } /// @@ -28,7 +36,7 @@ public IDictionary> GetFieldDeserializers() { /// public void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("emailAddress", EmailAddress); + writer.WriteObjectValue("emailAddress", EmailAddress); writer.WriteAdditionalData(AdditionalData); } } diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/SingleValueLegacyExtendedProperty.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/SingleValueLegacyExtendedProperty.cs index 72323aa8c..0e71cc8c4 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/SingleValueLegacyExtendedProperty.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/SingleValueLegacyExtendedProperty.cs @@ -8,6 +8,14 @@ public class SingleValueLegacyExtendedProperty : Entity, IParsable { /// A property value. public string Value { get; set; } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static new SingleValueLegacyExtendedProperty CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SingleValueLegacyExtendedProperty(); + } + /// /// The deserialization information for the current model /// public new IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Models/Microsoft/Graph/SizeRange.cs b/msgraph-mail/dotnet/Models/Microsoft/Graph/SizeRange.cs index c882d52a4..9a29f3aa9 100644 --- a/msgraph-mail/dotnet/Models/Microsoft/Graph/SizeRange.cs +++ b/msgraph-mail/dotnet/Models/Microsoft/Graph/SizeRange.cs @@ -18,6 +18,14 @@ public SizeRange() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static SizeRange CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SizeRange(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { diff --git a/msgraph-mail/dotnet/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs index db35acd7d..d5b3a9b71 100644 --- a/msgraph-mail/dotnet/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/InferenceClassification/InferenceClassificationRequestBuilder.cs @@ -110,7 +110,7 @@ public RequestInformation CreatePatchRequestInformation(Graphdotnetv4.Models.Mic /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. @@ -122,7 +122,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. @@ -135,7 +135,7 @@ public async Task DeleteAsync(Action> h = default, I public async Task PatchAsync(Graphdotnetv4.Models.Microsoft.Graph.InferenceClassification body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideItemRequestBuilder.cs similarity index 91% rename from msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideItemRequestBuilder.cs index 1883a9e87..42579b31f 100644 --- a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/Item/InferenceClassificationOverrideItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.InferenceClassification.Overrides.Item { /// Builds and executes requests for operations under \users\{user-id}\inferenceClassification\overrides\{inferenceClassificationOverride-id} - public class InferenceClassificationOverrideRequestBuilder { + public class InferenceClassificationOverrideItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class InferenceClassificationOverrideRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. + /// Instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public InferenceClassificationOverrideRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public InferenceClassificationOverrideItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; @@ -30,11 +30,11 @@ public InferenceClassificationOverrideRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// Instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. + /// Instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public InferenceClassificationOverrideRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public InferenceClassificationOverrideItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(InferenceClassificationO /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, InferenceClassificationOverride.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs index a3cf5f529..116f16218 100644 --- a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesRequestBuilder.cs @@ -18,10 +18,10 @@ public class OverridesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.inferenceClassification.overrides.item collection - public InferenceClassificationOverrideRequestBuilder this[string position] { get { + public InferenceClassificationOverrideItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("inferenceClassificationOverride_id", position); - return new InferenceClassificationOverrideRequestBuilder(urlTplParams, RequestAdapter); + return new InferenceClassificationOverrideItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new OverridesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(InferenceClassificationOv /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, OverridesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = def public async Task PostAsync(InferenceClassificationOverride body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, InferenceClassificationOverride.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesResponse.cs b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesResponse.cs index e0a727152..6404ea369 100644 --- a/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/InferenceClassification/Overrides/OverridesResponse.cs @@ -17,12 +17,20 @@ public OverridesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static OverridesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OverridesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as OverridesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as OverridesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as OverridesResponse).Value = n.GetCollectionOfObjectValues(InferenceClassificationOverride.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs index 5c1c91b72..27226f7d3 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersRequestBuilder.cs @@ -18,10 +18,10 @@ public class ChildFoldersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.childFolders.item collection - public MailFolderRequestBuilder this[string position] { get { + public MailFolderItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("mailFolder_id1", position); - return new MailFolderRequestBuilder(urlTplParams, RequestAdapter); + return new MailFolderItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new ChildFoldersRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MailFolder body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, ChildFoldersResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of child folders in the mailFolder. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = public async Task PostAsync(MailFolder body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MailFolder.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of child folders in the mailFolder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersResponse.cs index 2048c2481..c13366c96 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/ChildFoldersResponse.cs @@ -17,12 +17,20 @@ public ChildFoldersResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static ChildFoldersResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChildFoldersResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as ChildFoldersResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as ChildFoldersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as ChildFoldersResponse).Value = n.GetCollectionOfObjectValues(MailFolder.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderItemRequestBuilder.cs index 957abbf36..44dfd44fe 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/ChildFolders/Item/MailFolderItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.ChildFolders.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\childFolders\{mailFolder-id1} - public class MailFolderRequestBuilder { + public class MailFolderItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class MailFolderRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MailFolderRequestBuilder and sets the default values. + /// Instantiates a new MailFolderItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MailFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders/{mailFolder_id1}{?select,expand}"; @@ -30,11 +30,11 @@ public MailFolderRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Instantiates a new MailFolderRequestBuilder and sets the default values. + /// Instantiates a new MailFolderItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MailFolderRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders/{mailFolder_id1}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(MailFolder body, Action< /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of child folders in the mailFolder. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MailFolder.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of child folders in the mailFolder. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, A public async Task PatchAsync(MailFolder body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of child folders in the mailFolder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderItemRequestBuilder.cs similarity index 93% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderItemRequestBuilder.cs index 9203929f6..624ad95ea 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MailFolderItemRequestBuilder.cs @@ -14,7 +14,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id} - public class MailFolderRequestBuilder { + public class MailFolderItemRequestBuilder { public ChildFoldersRequestBuilder ChildFolders { get => new ChildFoldersRequestBuilder(PathParameters, RequestAdapter); } @@ -37,11 +37,11 @@ public class MailFolderRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MailFolderRequestBuilder and sets the default values. + /// Instantiates a new MailFolderItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MailFolderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}{?select}"; @@ -50,11 +50,11 @@ public MailFolderRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Instantiates a new MailFolderRequestBuilder and sets the default values. + /// Instantiates a new MailFolderItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MailFolderRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}{?select}"; @@ -126,7 +126,7 @@ public RequestInformation CreatePatchRequestInformation(MailFolder body, Action< /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The user's mail folders. Read-only. Nullable. @@ -138,7 +138,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MailFolder.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The user's mail folders. Read-only. Nullable. @@ -151,7 +151,7 @@ public async Task GetAsync(Action q = default, A public async Task PatchAsync(MailFolder body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The user's mail folders. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleItemRequestBuilder.cs index be586d090..4d90f87a0 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/Item/MessageRuleItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.MessageRules.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messageRules\{messageRule-id} - public class MessageRuleRequestBuilder { + public class MessageRuleItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class MessageRuleRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MessageRuleRequestBuilder and sets the default values. + /// Instantiates a new MessageRuleItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MessageRuleRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MessageRuleItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules/{messageRule_id}{?select}"; @@ -30,11 +30,11 @@ public MessageRuleRequestBuilder(Dictionary pathParameters, IReq RequestAdapter = requestAdapter; } /// - /// Instantiates a new MessageRuleRequestBuilder and sets the default values. + /// Instantiates a new MessageRuleItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MessageRuleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MessageRuleItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules/{messageRule_id}{?select}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(MessageRule body, Action /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of rules that apply to the user's Inbox folder. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MessageRule.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of rules that apply to the user's Inbox folder. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, public async Task PatchAsync(MessageRule body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of rules that apply to the user's Inbox folder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs index 55407ffe1..adaf22906 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MessageRulesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messageRules.item collection - public MessageRuleRequestBuilder this[string position] { get { + public MessageRuleItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("messageRule_id", position); - return new MessageRuleRequestBuilder(urlTplParams, RequestAdapter); + return new MessageRuleItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MessageRulesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MessageRule body, Action< /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MessageRulesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of rules that apply to the user's Inbox folder. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = public async Task PostAsync(MessageRule body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MessageRule.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of rules that apply to the user's Inbox folder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesResponse.cs index 7390f9a48..e83333b02 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MessageRules/MessageRulesResponse.cs @@ -17,12 +17,20 @@ public MessageRulesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MessageRulesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageRulesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MessageRulesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MessageRulesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MessageRulesResponse).Value = n.GetCollectionOfObjectValues(MessageRule.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index 9c8978b8c..61ac34f27 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -18,10 +18,10 @@ public class AttachmentsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messages.item.attachments.item collection - public AttachmentRequestBuilder this[string position] { get { + public AttachmentItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("attachment_id", position); - return new AttachmentRequestBuilder(urlTplParams, RequestAdapter); + return new AttachmentItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new AttachmentsRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Attachment body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, AttachmentsResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = d public async Task PostAsync(Attachment body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Attachment.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The fileAttachment and itemAttachment attachments for the message. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsResponse.cs index a98554936..3d317719b 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/AttachmentsResponse.cs @@ -17,12 +17,20 @@ public AttachmentsResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static AttachmentsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AttachmentsResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as AttachmentsResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as AttachmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as AttachmentsResponse).Value = n.GetCollectionOfObjectValues(Attachment.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs index 10bd5ada7..78b11ba59 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.Messages.Item.Attachments.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\attachments\{attachment-id} - public class AttachmentRequestBuilder { + public class AttachmentItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class AttachmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new AttachmentRequestBuilder and sets the default values. + /// Instantiates a new AttachmentItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public AttachmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -30,11 +30,11 @@ public AttachmentRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Instantiates a new AttachmentRequestBuilder and sets the default values. + /// Instantiates a new AttachmentItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public AttachmentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(Attachment body, Action< /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Attachment.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, A public async Task PatchAsync(Attachment body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The fileAttachment and itemAttachment attachments for the message. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index b655f82ed..00cf450f7 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -18,10 +18,10 @@ public class ExtensionsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messages.item.extensions.item collection - public ExtensionRequestBuilder this[string position] { get { + public ExtensionItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("extension_id", position); - return new ExtensionRequestBuilder(urlTplParams, RequestAdapter); + return new ExtensionItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new ExtensionsRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, ExtensionsResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = de public async Task PostAsync(Extension body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Extension.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of open extensions defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsResponse.cs index c14e03823..1dc36de95 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/ExtensionsResponse.cs @@ -17,12 +17,20 @@ public ExtensionsResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static ExtensionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExtensionsResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as ExtensionsResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as ExtensionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as ExtensionsResponse).Value = n.GetCollectionOfObjectValues(Extension.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs similarity index 93% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs index 4137d0fc5..ad206996a 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.Messages.Item.Extensions.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\extensions\{extension-id} - public class ExtensionRequestBuilder { + public class ExtensionItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new ExtensionRequestBuilder and sets the default values. + /// Instantiates a new ExtensionItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public ExtensionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -30,11 +30,11 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Instantiates a new ExtensionRequestBuilder and sets the default values. + /// Instantiates a new ExtensionItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public ExtensionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Extension.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, Ac public async Task PatchAsync(Extension body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of open extensions defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageItemRequestBuilder.cs similarity index 93% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageItemRequestBuilder.cs index 225416c55..3632f0744 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MessageItemRequestBuilder.cs @@ -14,7 +14,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.Messages.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id} - public class MessageRequestBuilder { + public class MessageItemRequestBuilder { public AttachmentsRequestBuilder Attachments { get => new AttachmentsRequestBuilder(PathParameters, RequestAdapter); } @@ -37,11 +37,11 @@ public class MessageRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MessageRequestBuilder and sets the default values. + /// Instantiates a new MessageItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MessageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MessageItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}{?select,expand}"; @@ -50,11 +50,11 @@ public MessageRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Instantiates a new MessageRequestBuilder and sets the default values. + /// Instantiates a new MessageItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MessageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MessageItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}{?select,expand}"; @@ -126,7 +126,7 @@ public RequestInformation CreatePatchRequestInformation(Message body, Action public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of messages in the mailFolder. @@ -138,7 +138,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Message.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of messages in the mailFolder. @@ -151,7 +151,7 @@ public async Task GetAsync(Action q = default, Acti public async Task PatchAsync(Message body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of messages in the mailFolder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 91% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs index 0de48d63a..1e1696eab 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.Messages.Item.MultiValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} - public class MultiValueLegacyExtendedPropertyRequestBuilder { + public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(MultiValueLegacyExtended /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index a0af2eb21..9a0141b3e 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MultiValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item collection - public MultiValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public MultiValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("multiValueLegacyExtendedProperty_id", position); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MultiValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MultiValueLegacyExtendedP /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(MultiValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs index 034605572..b31812790 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public MultiValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MultiValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MultiValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MultiValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs index df0e009d2..8f358ec13 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.Messages.Item.SingleValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} - public class SingleValueLegacyExtendedPropertyRequestBuilder { + public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(SingleValueLegacyExtende /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index b281d5b61..ed8e1cd7c 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class SingleValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item collection - public SingleValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public SingleValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("singleValueLegacyExtendedProperty_id", position); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new SingleValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(SingleValueLegacyExtended /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(SingleValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs index 06966b0da..16ea5b98f 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public SingleValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static SingleValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SingleValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as SingleValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs index ba1401bbd..9f681040e 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/Item/Value/ContentRequestBuilder.cs @@ -84,7 +84,7 @@ public RequestInformation CreatePutRequestInformation(Stream body, Action public async Task GetAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(h, o); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// Update media content for the navigation property messages in users @@ -97,7 +97,7 @@ public async Task GetAsync(Action> h = defau public async Task PutAsync(Stream body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePutRequestInformation(body, h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } } } diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs index 8356903ec..ba53a8e2d 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MessagesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.messages.item collection - public MessageRequestBuilder this[string position] { get { + public MessageItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("message_id", position); - return new MessageRequestBuilder(urlTplParams, RequestAdapter); + return new MessageItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MessagesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Message body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MessagesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of messages in the mailFolder. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = defa public async Task PostAsync(Message body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Message.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of messages in the mailFolder. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesResponse.cs index 3f9561ab0..ef4c12d96 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/Messages/MessagesResponse.cs @@ -17,12 +17,20 @@ public MessagesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MessagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessagesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MessagesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MessagesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MessagesResponse).Value = n.GetCollectionOfObjectValues(Message.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 91% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs index b63b58db7..b74cef49d 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.MultiValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} - public class MultiValueLegacyExtendedPropertyRequestBuilder { + public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(MultiValueLegacyExtended /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index 4378a81c2..3585c2825 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MultiValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.multiValueExtendedProperties.item collection - public MultiValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public MultiValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("multiValueLegacyExtendedProperty_id", position); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MultiValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MultiValueLegacyExtendedP /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(MultiValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs index f988845ef..0158dbc96 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public MultiValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MultiValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MultiValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MultiValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 93% rename from msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs index 803d53c2b..270dbc462 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.MailFolders.Item.SingleValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} - public class SingleValueLegacyExtendedPropertyRequestBuilder { + public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(SingleValueLegacyExtende /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index f625d887e..fffc4c1db 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class SingleValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item.singleValueExtendedProperties.item collection - public SingleValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public SingleValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("singleValueLegacyExtendedProperty_id", position); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new SingleValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(SingleValueLegacyExtended /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(SingleValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs index 6a818ed8a..c5856e58a 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public SingleValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static SingleValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SingleValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as SingleValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersRequestBuilder.cs index e299ef673..9a917ce48 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersRequestBuilder.cs @@ -18,10 +18,10 @@ public class MailFoldersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.mailFolders.item collection - public MailFolderRequestBuilder this[string position] { get { + public MailFolderItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("mailFolder_id", position); - return new MailFolderRequestBuilder(urlTplParams, RequestAdapter); + return new MailFolderItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MailFoldersRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MailFolder body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MailFoldersResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The user's mail folders. Read-only. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = d public async Task PostAsync(MailFolder body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MailFolder.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The user's mail folders. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersResponse.cs b/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersResponse.cs index 8eb16f5ad..34c6dcd6c 100644 --- a/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/MailFolders/MailFoldersResponse.cs @@ -17,12 +17,20 @@ public MailFoldersResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MailFoldersResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MailFoldersResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MailFoldersResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MailFoldersResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MailFoldersResponse).Value = n.GetCollectionOfObjectValues(MailFolder.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs index cf1006907..2c12a9a42 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsRequestBuilder.cs @@ -18,10 +18,10 @@ public class AttachmentsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.messages.item.attachments.item collection - public AttachmentRequestBuilder this[string position] { get { + public AttachmentItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("attachment_id", position); - return new AttachmentRequestBuilder(urlTplParams, RequestAdapter); + return new AttachmentItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new AttachmentsRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Attachment body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, AttachmentsResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = d public async Task PostAsync(Attachment body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Attachment.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The fileAttachment and itemAttachment attachments for the message. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsResponse.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsResponse.cs index 1768955a9..6550606df 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/AttachmentsResponse.cs @@ -17,12 +17,20 @@ public AttachmentsResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static AttachmentsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AttachmentsResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as AttachmentsResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as AttachmentsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as AttachmentsResponse).Value = n.GetCollectionOfObjectValues(Attachment.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs index 6903a902e..cf9609fc7 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Attachments/Item/AttachmentItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.Messages.Item.Attachments.Item { /// Builds and executes requests for operations under \users\{user-id}\messages\{message-id}\attachments\{attachment-id} - public class AttachmentRequestBuilder { + public class AttachmentItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class AttachmentRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new AttachmentRequestBuilder and sets the default values. + /// Instantiates a new AttachmentItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public AttachmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -30,11 +30,11 @@ public AttachmentRequestBuilder(Dictionary pathParameters, IRequ RequestAdapter = requestAdapter; } /// - /// Instantiates a new AttachmentRequestBuilder and sets the default values. + /// Instantiates a new AttachmentItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public AttachmentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(Attachment body, Action< /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Attachment.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The fileAttachment and itemAttachment attachments for the message. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, A public async Task PatchAsync(Attachment body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The fileAttachment and itemAttachment attachments for the message. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs index 1443520f1..6b3a142a7 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsRequestBuilder.cs @@ -18,10 +18,10 @@ public class ExtensionsRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.messages.item.extensions.item collection - public ExtensionRequestBuilder this[string position] { get { + public ExtensionItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("extension_id", position); - return new ExtensionRequestBuilder(urlTplParams, RequestAdapter); + return new ExtensionItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new ExtensionsRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Extension body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, ExtensionsResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = de public async Task PostAsync(Extension body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Extension.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of open extensions defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsResponse.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsResponse.cs index 8b8cda5f2..078ea8252 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/ExtensionsResponse.cs @@ -17,12 +17,20 @@ public ExtensionsResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static ExtensionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExtensionsResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as ExtensionsResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as ExtensionsResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as ExtensionsResponse).Value = n.GetCollectionOfObjectValues(Extension.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs index fe5103eb2..15b8dc634 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Extensions/Item/ExtensionItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.Messages.Item.Extensions.Item { /// Builds and executes requests for operations under \users\{user-id}\messages\{message-id}\extensions\{extension-id} - public class ExtensionRequestBuilder { + public class ExtensionItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class ExtensionRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new ExtensionRequestBuilder and sets the default values. + /// Instantiates a new ExtensionItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public ExtensionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -30,11 +30,11 @@ public ExtensionRequestBuilder(Dictionary pathParameters, IReque RequestAdapter = requestAdapter; } /// - /// Instantiates a new ExtensionRequestBuilder and sets the default values. + /// Instantiates a new ExtensionItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public ExtensionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(Extension body, Action public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Extension.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of open extensions defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action q = default, Ac public async Task PatchAsync(Extension body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of open extensions defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/MessageRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/MessageItemRequestBuilder.cs similarity index 93% rename from msgraph-mail/dotnet/Users/Item/Messages/Item/MessageRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/Messages/Item/MessageItemRequestBuilder.cs index b9a199ddc..bb2250815 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/MessageRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/MessageItemRequestBuilder.cs @@ -14,7 +14,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.Messages.Item { /// Builds and executes requests for operations under \users\{user-id}\messages\{message-id} - public class MessageRequestBuilder { + public class MessageItemRequestBuilder { public AttachmentsRequestBuilder Attachments { get => new AttachmentsRequestBuilder(PathParameters, RequestAdapter); } @@ -37,11 +37,11 @@ public class MessageRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MessageRequestBuilder and sets the default values. + /// Instantiates a new MessageItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MessageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MessageItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}{?select}"; @@ -50,11 +50,11 @@ public MessageRequestBuilder(Dictionary pathParameters, IRequest RequestAdapter = requestAdapter; } /// - /// Instantiates a new MessageRequestBuilder and sets the default values. + /// Instantiates a new MessageItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MessageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MessageItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}{?select}"; @@ -126,7 +126,7 @@ public RequestInformation CreatePatchRequestInformation(Message body, Action public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The messages in a mailbox or folder. Read-only. Nullable. @@ -138,7 +138,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Message.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The messages in a mailbox or folder. Read-only. Nullable. @@ -151,7 +151,7 @@ public async Task GetAsync(Action q = default, Acti public async Task PatchAsync(Message body, Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The messages in a mailbox or folder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 91% rename from msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs index 39fd48ca4..d1ac5d707 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/Item/MultiValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.Messages.Item.MultiValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} - public class MultiValueLegacyExtendedPropertyRequestBuilder { + public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(Dictionary RequestAdapter = requestAdapter; } /// - /// Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public MultiValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(MultiValueLegacyExtended /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs index d4be4eadb..cc6d6b832 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MultiValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.messages.item.multiValueExtendedProperties.item collection - public MultiValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public MultiValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("multiValueLegacyExtendedProperty_id", position); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MultiValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(MultiValueLegacyExtendedP /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of multi-value extended properties defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(MultiValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of multi-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs index 2f9d4c698..add6feff6 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/MultiValueExtendedProperties/MultiValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public MultiValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MultiValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MultiValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MultiValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MultiValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs similarity index 92% rename from msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs index 2652c9bbc..f45f6985c 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/Item/SingleValueLegacyExtendedPropertyItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item.Messages.Item.SingleValueExtendedProperties.Item { /// Builds and executes requests for operations under \users\{user-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} - public class SingleValueLegacyExtendedPropertyRequestBuilder { + public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /// Path parameters for the request private Dictionary PathParameters { get; set; } /// The request adapter to use to execute the requests. @@ -17,11 +17,11 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -30,11 +30,11 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(Dictionary - /// Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + /// Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public SingleValueLegacyExtendedPropertyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -106,7 +106,7 @@ public RequestInformation CreatePatchRequestInformation(SingleValueLegacyExtende /// public async Task DeleteAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateDeleteRequestInformation(h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -118,7 +118,7 @@ public async Task DeleteAsync(Action> h = default, I /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -131,7 +131,7 @@ public async Task GetAsync(Action> h = default, IEnumerable 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); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs index a162b9381..79ad0e6e6 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.cs @@ -18,10 +18,10 @@ public class SingleValueExtendedPropertiesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.messages.item.singleValueExtendedProperties.item collection - public SingleValueLegacyExtendedPropertyRequestBuilder this[string position] { get { + public SingleValueLegacyExtendedPropertyItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("singleValueLegacyExtendedProperty_id", position); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, RequestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new SingleValueExtendedPropertiesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(SingleValueLegacyExtended /// public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueExtendedPropertiesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The collection of single-value extended properties defined for the message. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action PostAsync(SingleValueLegacyExtendedProperty body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The collection of single-value extended properties defined for the message. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs index 9d029b892..eeba53ee7 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/SingleValueExtendedProperties/SingleValueExtendedPropertiesResponse.cs @@ -17,12 +17,20 @@ public SingleValueExtendedPropertiesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static SingleValueExtendedPropertiesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SingleValueExtendedPropertiesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as SingleValueExtendedPropertiesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as SingleValueExtendedPropertiesResponse).Value = n.GetCollectionOfObjectValues(SingleValueLegacyExtendedProperty.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs index 71541224f..6d6a1e20c 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/Item/Value/ContentRequestBuilder.cs @@ -84,7 +84,7 @@ public RequestInformation CreatePutRequestInformation(Stream body, Action public async Task GetAsync(Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(h, o); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, responseHandler, default, cancellationToken); } /// /// Update media content for the navigation property messages in users @@ -97,7 +97,7 @@ public async Task GetAsync(Action> h = defau public async Task PutAsync(Stream body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePutRequestInformation(body, h, o); - await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, cancellationToken); + await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken); } } } diff --git a/msgraph-mail/dotnet/Users/Item/Messages/MessagesRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/Messages/MessagesRequestBuilder.cs index 512708e57..7051b4e86 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/MessagesRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/MessagesRequestBuilder.cs @@ -18,10 +18,10 @@ public class MessagesRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item.messages.item collection - public MessageRequestBuilder this[string position] { get { + public MessageItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("message_id", position); - return new MessageRequestBuilder(urlTplParams, RequestAdapter); + return new MessageItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new MessagesRequestBuilder and sets the default values. @@ -99,7 +99,7 @@ public RequestInformation CreatePostRequestInformation(Message body, Action public async Task GetAsync(Action q = default, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { var requestInfo = CreateGetRequestInformation(q, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, MessagesResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// /// The messages in a mailbox or folder. Read-only. Nullable. @@ -112,7 +112,7 @@ public async Task GetAsync(Action q = defa public async Task PostAsync(Message body, Action> h = default, IEnumerable o = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = CreatePostRequestInformation(body, h, o); - return await RequestAdapter.SendAsync(requestInfo, responseHandler, cancellationToken); + return await RequestAdapter.SendAsync(requestInfo, Message.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken); } /// The messages in a mailbox or folder. Read-only. Nullable. public class GetQueryParameters : QueryParametersBase { diff --git a/msgraph-mail/dotnet/Users/Item/Messages/MessagesResponse.cs b/msgraph-mail/dotnet/Users/Item/Messages/MessagesResponse.cs index 9aa29983f..f1c281822 100644 --- a/msgraph-mail/dotnet/Users/Item/Messages/MessagesResponse.cs +++ b/msgraph-mail/dotnet/Users/Item/Messages/MessagesResponse.cs @@ -17,12 +17,20 @@ public MessagesResponse() { AdditionalData = new Dictionary(); } /// + /// Creates a new instance of the appropriate class based on discriminator value + /// The parse node to use to read the discriminator value and create the object + /// + public static MessagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessagesResponse(); + } + /// /// The deserialization information for the current model /// public IDictionary> GetFieldDeserializers() { return new Dictionary> { {"@odata.nextLink", (o,n) => { (o as MessagesResponse).NextLink = n.GetStringValue(); } }, - {"value", (o,n) => { (o as MessagesResponse).Value = n.GetCollectionOfObjectValues().ToList(); } }, + {"value", (o,n) => { (o as MessagesResponse).Value = n.GetCollectionOfObjectValues(Message.CreateFromDiscriminatorValue).ToList(); } }, }; } /// diff --git a/msgraph-mail/dotnet/Users/Item/UserRequestBuilder.cs b/msgraph-mail/dotnet/Users/Item/UserItemRequestBuilder.cs similarity index 86% rename from msgraph-mail/dotnet/Users/Item/UserRequestBuilder.cs rename to msgraph-mail/dotnet/Users/Item/UserItemRequestBuilder.cs index fabcb740f..e271b1339 100644 --- a/msgraph-mail/dotnet/Users/Item/UserRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/Item/UserItemRequestBuilder.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Graphdotnetv4.Users.Item { /// Builds and executes requests for operations under \users\{user-id} - public class UserRequestBuilder { + public class UserItemRequestBuilder { public InferenceClassificationRequestBuilder InferenceClassification { get => new InferenceClassificationRequestBuilder(PathParameters, RequestAdapter); } @@ -26,11 +26,11 @@ public class UserRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// - /// Instantiates a new UserRequestBuilder and sets the default values. + /// Instantiates a new UserItemRequestBuilder and sets the default values. /// Path parameters for the request /// The request adapter to use to execute the requests. /// - public UserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { + public UserItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) { _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}"; @@ -39,11 +39,11 @@ public UserRequestBuilder(Dictionary pathParameters, IRequestAda RequestAdapter = requestAdapter; } /// - /// Instantiates a new UserRequestBuilder and sets the default values. + /// Instantiates a new UserItemRequestBuilder and sets the default values. /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. /// - public UserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { + public UserItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) { if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl)); _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); UrlTemplate = "{+baseurl}/users/{user_id}"; diff --git a/msgraph-mail/dotnet/Users/UsersRequestBuilder.cs b/msgraph-mail/dotnet/Users/UsersRequestBuilder.cs index b4e008536..0f5bc2b86 100644 --- a/msgraph-mail/dotnet/Users/UsersRequestBuilder.cs +++ b/msgraph-mail/dotnet/Users/UsersRequestBuilder.cs @@ -15,10 +15,10 @@ public class UsersRequestBuilder { /// Url template to use to build the URL for the current request builder private string UrlTemplate { get; set; } /// Gets an item from the Graphdotnetv4.users.item collection - public UserRequestBuilder this[string position] { get { + public UserItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("user_id", position); - return new UserRequestBuilder(urlTplParams, RequestAdapter); + return new UserItemRequestBuilder(urlTplParams, RequestAdapter); } } /// /// Instantiates a new UsersRequestBuilder and sets the default values. diff --git a/msgraph-mail/go/utilities/api_client.go b/msgraph-mail/go/utilities/api_client.go index 3cd0dc668..609fa526b 100644 --- a/msgraph-mail/go/utilities/api_client.go +++ b/msgraph-mail/go/utilities/api_client.go @@ -33,7 +33,7 @@ func (m *ApiClient) Users()(*ie51e765764484004639cdfca9cb330e622fbf042d77be5ba8e return ie51e765764484004639cdfca9cb330e622fbf042d77be5ba8e7a002ffc8f8ed7.NewUsersRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // UsersById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item collection -func (m *ApiClient) UsersById(id string)(*i993da4875956788f567345c5c97cefaefa8f33555fde8bb29d1fd49e374ccccd.UserRequestBuilder) { +func (m *ApiClient) UsersById(id string)(*i993da4875956788f567345c5c97cefaefa8f33555fde8bb29d1fd49e374ccccd.UserItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -41,5 +41,5 @@ func (m *ApiClient) UsersById(id string)(*i993da4875956788f567345c5c97cefaefa8f3 if id != "" { urlTplParams["user_id"] = id } - return i993da4875956788f567345c5c97cefaefa8f33555fde8bb29d1fd49e374ccccd.NewUserRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i993da4875956788f567345c5c97cefaefa8f33555fde8bb29d1fd49e374ccccd.NewUserItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/attachment.go b/msgraph-mail/go/utilities/models/microsoft/graph/attachment.go index 0a5937523..3f071da75 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/attachment.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/attachment.go @@ -14,7 +14,7 @@ type Attachment struct { isInline *bool; // 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 lastModifiedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time; - // The display name of the attachment. This does not need to be the actual file name. + // The attachment's file name. name *string; // The length of the attachment in bytes. size *int32; @@ -26,6 +26,10 @@ func NewAttachment()(*Attachment) { } return m } +// CreateAttachmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateAttachmentFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewAttachment(), nil +} // GetContentType gets the contentType property value. The MIME type. func (m *Attachment) GetContentType()(*string) { if m == nil { @@ -34,38 +38,6 @@ func (m *Attachment) GetContentType()(*string) { return m.contentType } } -// GetIsInline gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. -func (m *Attachment) GetIsInline()(*bool) { - if m == nil { - return nil - } else { - return m.isInline - } -} -// GetLastModifiedDateTime gets the lastModifiedDateTime property value. 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 -func (m *Attachment) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { - if m == nil { - return nil - } else { - return m.lastModifiedDateTime - } -} -// GetName gets the name property value. The display name of the attachment. This does not need to be the actual file name. -func (m *Attachment) GetName()(*string) { - if m == nil { - return nil - } else { - return m.name - } -} -// GetSize gets the size property value. The length of the attachment in bytes. -func (m *Attachment) GetSize()(*int32) { - if m == nil { - return nil - } else { - return m.size - } -} // GetFieldDeserializers the deserialization information for the current model func (m *Attachment) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() @@ -121,6 +93,38 @@ func (m *Attachment) GetFieldDeserializers()(map[string]func(interface{}, i04eb5 } return res } +// GetIsInline gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. +func (m *Attachment) GetIsInline()(*bool) { + if m == nil { + return nil + } else { + return m.isInline + } +} +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. 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 +func (m *Attachment) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + if m == nil { + return nil + } else { + return m.lastModifiedDateTime + } +} +// GetName gets the name property value. The attachment's file name. +func (m *Attachment) GetName()(*string) { + if m == nil { + return nil + } else { + return m.name + } +} +// GetSize gets the size property value. The length of the attachment in bytes. +func (m *Attachment) GetSize()(*int32) { + if m == nil { + return nil + } else { + return m.size + } +} func (m *Attachment) IsNil()(bool) { return m == nil } @@ -180,7 +184,7 @@ func (m *Attachment) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3a m.lastModifiedDateTime = value } } -// SetName sets the name property value. The display name of the attachment. This does not need to be the actual file name. +// SetName sets the name property value. The attachment's file name. func (m *Attachment) SetName(value *string)() { if m != nil { m.name = value diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/attachmentable.go b/msgraph-mail/go/utilities/models/microsoft/graph/attachmentable.go new file mode 100644 index 000000000..225bd464e --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/attachmentable.go @@ -0,0 +1,20 @@ +package graph + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// Attachmentable +type Attachmentable interface { + Entityable + GetContentType()(*string) + GetIsInline()(*bool) + GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSize()(*int32) + SetContentType(value *string)() + SetIsInline(value *bool)() + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSize(value *int32)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zone.go b/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zone.go index a0a9d3f1b..ece7d9a71 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zone.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zone.go @@ -8,9 +8,9 @@ import ( type DateTimeTimeZone struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]interface{}; - // A single point of time in a combined date and time representation ({date}T{time}). For example, '2019-04-16T09:00:00'. + // A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). dateTime *string; - // Represents a time zone, for example, 'Pacific Standard Time'. See below for possible values. + // Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. timeZone *string; } // NewDateTimeTimeZone instantiates a new dateTimeTimeZone and sets the default values. @@ -20,6 +20,10 @@ func NewDateTimeTimeZone()(*DateTimeTimeZone) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateDateTimeTimeZoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateDateTimeTimeZoneFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewDateTimeTimeZone(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *DateTimeTimeZone) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -28,7 +32,7 @@ func (m *DateTimeTimeZone) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetDateTime gets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}). For example, '2019-04-16T09:00:00'. +// GetDateTime gets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). func (m *DateTimeTimeZone) GetDateTime()(*string) { if m == nil { return nil @@ -36,14 +40,6 @@ func (m *DateTimeTimeZone) GetDateTime()(*string) { return m.dateTime } } -// GetTimeZone gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for possible values. -func (m *DateTimeTimeZone) GetTimeZone()(*string) { - if m == nil { - return nil - } else { - return m.timeZone - } -} // GetFieldDeserializers the deserialization information for the current model func (m *DateTimeTimeZone) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -69,6 +65,14 @@ func (m *DateTimeTimeZone) GetFieldDeserializers()(map[string]func(interface{}, } return res } +// GetTimeZone gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. +func (m *DateTimeTimeZone) GetTimeZone()(*string) { + if m == nil { + return nil + } else { + return m.timeZone + } +} func (m *DateTimeTimeZone) IsNil()(bool) { return m == nil } @@ -100,13 +104,13 @@ func (m *DateTimeTimeZone) SetAdditionalData(value map[string]interface{})() { m.additionalData = value } } -// SetDateTime sets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}). For example, '2019-04-16T09:00:00'. +// SetDateTime sets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). func (m *DateTimeTimeZone) SetDateTime(value *string)() { if m != nil { m.dateTime = value } } -// SetTimeZone sets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for possible values. +// SetTimeZone sets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. func (m *DateTimeTimeZone) SetTimeZone(value *string)() { if m != nil { m.timeZone = value diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zoneable.go b/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zoneable.go new file mode 100644 index 000000000..ad3386c49 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/date_time_time_zoneable.go @@ -0,0 +1,14 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// DateTimeTimeZoneable +type DateTimeTimeZoneable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetDateTime()(*string) + GetTimeZone()(*string) + SetDateTime(value *string)() + SetTimeZone(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/email_address.go b/msgraph-mail/go/utilities/models/microsoft/graph/email_address.go index b9a3ba262..59e67ed62 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/email_address.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/email_address.go @@ -8,9 +8,9 @@ import ( type EmailAddress struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]interface{}; - // The email address of an entity instance. + // The email address of the person or entity. address *string; - // The display name of an entity instance. + // The display name of the person or entity. name *string; } // NewEmailAddress instantiates a new emailAddress and sets the default values. @@ -20,6 +20,10 @@ func NewEmailAddress()(*EmailAddress) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateEmailAddressFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateEmailAddressFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewEmailAddress(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *EmailAddress) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -28,7 +32,7 @@ func (m *EmailAddress) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetAddress gets the address property value. The email address of an entity instance. +// GetAddress gets the address property value. The email address of the person or entity. func (m *EmailAddress) GetAddress()(*string) { if m == nil { return nil @@ -36,14 +40,6 @@ func (m *EmailAddress) GetAddress()(*string) { return m.address } } -// GetName gets the name property value. The display name of an entity instance. -func (m *EmailAddress) GetName()(*string) { - if m == nil { - return nil - } else { - return m.name - } -} // GetFieldDeserializers the deserialization information for the current model func (m *EmailAddress) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -69,6 +65,14 @@ func (m *EmailAddress) GetFieldDeserializers()(map[string]func(interface{}, i04e } return res } +// GetName gets the name property value. The display name of the person or entity. +func (m *EmailAddress) GetName()(*string) { + if m == nil { + return nil + } else { + return m.name + } +} func (m *EmailAddress) IsNil()(bool) { return m == nil } @@ -100,13 +104,13 @@ func (m *EmailAddress) SetAdditionalData(value map[string]interface{})() { m.additionalData = value } } -// SetAddress sets the address property value. The email address of an entity instance. +// SetAddress sets the address property value. The email address of the person or entity. func (m *EmailAddress) SetAddress(value *string)() { if m != nil { m.address = value } } -// SetName sets the name property value. The display name of an entity instance. +// SetName sets the name property value. The display name of the person or entity. func (m *EmailAddress) SetName(value *string)() { if m != nil { m.name = value diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/email_addressable.go b/msgraph-mail/go/utilities/models/microsoft/graph/email_addressable.go new file mode 100644 index 000000000..82e00e164 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/email_addressable.go @@ -0,0 +1,14 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// EmailAddressable +type EmailAddressable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetAddress()(*string) + GetName()(*string) + SetAddress(value *string)() + SetName(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/entity.go b/msgraph-mail/go/utilities/models/microsoft/graph/entity.go index c498573b9..c955138bc 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/entity.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/entity.go @@ -18,6 +18,10 @@ func NewEntity()(*Entity) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateEntityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateEntityFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewEntity(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *Entity) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -26,14 +30,6 @@ func (m *Entity) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetId gets the id property value. Read-only. -func (m *Entity) GetId()(*string) { - if m == nil { - return nil - } else { - return m.id - } -} // GetFieldDeserializers the deserialization information for the current model func (m *Entity) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -49,6 +45,14 @@ func (m *Entity) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309a } return res } +// GetId gets the id property value. Read-only. +func (m *Entity) GetId()(*string) { + if m == nil { + return nil + } else { + return m.id + } +} func (m *Entity) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/entityable.go b/msgraph-mail/go/utilities/models/microsoft/graph/entityable.go new file mode 100644 index 000000000..927bac2c9 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/entityable.go @@ -0,0 +1,12 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// Entityable +type Entityable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetId()(*string) + SetId(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/extension.go b/msgraph-mail/go/utilities/models/microsoft/graph/extension.go index 194df4279..198118ed6 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/extension.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/extension.go @@ -15,6 +15,10 @@ func NewExtension()(*Extension) { } return m } +// CreateExtensionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateExtensionFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewExtension(), nil +} // GetFieldDeserializers the deserialization information for the current model func (m *Extension) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/extensionable.go b/msgraph-mail/go/utilities/models/microsoft/graph/extensionable.go new file mode 100644 index 000000000..e36e71ed4 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/extensionable.go @@ -0,0 +1,5 @@ +package graph +// Extensionable +type Extensionable interface { + Entityable +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/followup_flag.go b/msgraph-mail/go/utilities/models/microsoft/graph/followup_flag.go index f46f18498..92e175077 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/followup_flag.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/followup_flag.go @@ -9,13 +9,13 @@ type FollowupFlag struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]interface{}; // - completedDateTime *DateTimeTimeZone; + completedDateTime DateTimeTimeZoneable; // - dueDateTime *DateTimeTimeZone; + dueDateTime DateTimeTimeZoneable; // flagStatus *FollowupFlagStatus; // - startDateTime *DateTimeTimeZone; + startDateTime DateTimeTimeZoneable; } // NewFollowupFlag instantiates a new followupFlag and sets the default values. func NewFollowupFlag()(*FollowupFlag) { @@ -24,6 +24,10 @@ func NewFollowupFlag()(*FollowupFlag) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateFollowupFlagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateFollowupFlagFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewFollowupFlag(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *FollowupFlag) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -33,7 +37,7 @@ func (m *FollowupFlag) GetAdditionalData()(map[string]interface{}) { } } // GetCompletedDateTime gets the completedDateTime property value. -func (m *FollowupFlag) GetCompletedDateTime()(*DateTimeTimeZone) { +func (m *FollowupFlag) GetCompletedDateTime()(DateTimeTimeZoneable) { if m == nil { return nil } else { @@ -41,49 +45,33 @@ func (m *FollowupFlag) GetCompletedDateTime()(*DateTimeTimeZone) { } } // GetDueDateTime gets the dueDateTime property value. -func (m *FollowupFlag) GetDueDateTime()(*DateTimeTimeZone) { +func (m *FollowupFlag) GetDueDateTime()(DateTimeTimeZoneable) { if m == nil { return nil } else { return m.dueDateTime } } -// GetFlagStatus gets the flagStatus property value. -func (m *FollowupFlag) GetFlagStatus()(*FollowupFlagStatus) { - if m == nil { - return nil - } else { - return m.flagStatus - } -} -// GetStartDateTime gets the startDateTime property value. -func (m *FollowupFlag) GetStartDateTime()(*DateTimeTimeZone) { - if m == nil { - return nil - } else { - return m.startDateTime - } -} // GetFieldDeserializers the deserialization information for the current model func (m *FollowupFlag) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) res["completedDateTime"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewDateTimeTimeZone() }) + val, err := n.GetObjectValue(CreateDateTimeTimeZoneFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetCompletedDateTime(val.(*DateTimeTimeZone)) + m.SetCompletedDateTime(val.(DateTimeTimeZoneable)) } return nil } res["dueDateTime"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewDateTimeTimeZone() }) + val, err := n.GetObjectValue(CreateDateTimeTimeZoneFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetDueDateTime(val.(*DateTimeTimeZone)) + m.SetDueDateTime(val.(DateTimeTimeZoneable)) } return nil } @@ -98,17 +86,33 @@ func (m *FollowupFlag) GetFieldDeserializers()(map[string]func(interface{}, i04e return nil } res["startDateTime"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewDateTimeTimeZone() }) + val, err := n.GetObjectValue(CreateDateTimeTimeZoneFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetStartDateTime(val.(*DateTimeTimeZone)) + m.SetStartDateTime(val.(DateTimeTimeZoneable)) } return nil } return res } +// GetFlagStatus gets the flagStatus property value. +func (m *FollowupFlag) GetFlagStatus()(*FollowupFlagStatus) { + if m == nil { + return nil + } else { + return m.flagStatus + } +} +// GetStartDateTime gets the startDateTime property value. +func (m *FollowupFlag) GetStartDateTime()(DateTimeTimeZoneable) { + if m == nil { + return nil + } else { + return m.startDateTime + } +} func (m *FollowupFlag) IsNil()(bool) { return m == nil } @@ -154,13 +158,13 @@ func (m *FollowupFlag) SetAdditionalData(value map[string]interface{})() { } } // SetCompletedDateTime sets the completedDateTime property value. -func (m *FollowupFlag) SetCompletedDateTime(value *DateTimeTimeZone)() { +func (m *FollowupFlag) SetCompletedDateTime(value DateTimeTimeZoneable)() { if m != nil { m.completedDateTime = value } } // SetDueDateTime sets the dueDateTime property value. -func (m *FollowupFlag) SetDueDateTime(value *DateTimeTimeZone)() { +func (m *FollowupFlag) SetDueDateTime(value DateTimeTimeZoneable)() { if m != nil { m.dueDateTime = value } @@ -172,7 +176,7 @@ func (m *FollowupFlag) SetFlagStatus(value *FollowupFlagStatus)() { } } // SetStartDateTime sets the startDateTime property value. -func (m *FollowupFlag) SetStartDateTime(value *DateTimeTimeZone)() { +func (m *FollowupFlag) SetStartDateTime(value DateTimeTimeZoneable)() { if m != nil { m.startDateTime = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/followup_flagable.go b/msgraph-mail/go/utilities/models/microsoft/graph/followup_flagable.go new file mode 100644 index 000000000..273c05778 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/followup_flagable.go @@ -0,0 +1,18 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// FollowupFlagable +type FollowupFlagable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetCompletedDateTime()(DateTimeTimeZoneable) + GetDueDateTime()(DateTimeTimeZoneable) + GetFlagStatus()(*FollowupFlagStatus) + GetStartDateTime()(DateTimeTimeZoneable) + SetCompletedDateTime(value DateTimeTimeZoneable)() + SetDueDateTime(value DateTimeTimeZoneable)() + SetFlagStatus(value *FollowupFlagStatus)() + SetStartDateTime(value DateTimeTimeZoneable)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification.go b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification.go index 8abc63ba7..cad702759 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification.go @@ -8,7 +8,7 @@ import ( type InferenceClassification struct { Entity // A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. - overrides []InferenceClassificationOverride; + overrides []InferenceClassificationOverrideable; } // NewInferenceClassification instantiates a new inferenceClassification and sets the default values. func NewInferenceClassification()(*InferenceClassification) { @@ -17,26 +17,22 @@ func NewInferenceClassification()(*InferenceClassification) { } return m } -// GetOverrides gets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassification) GetOverrides()([]InferenceClassificationOverride) { - if m == nil { - return nil - } else { - return m.overrides - } +// CreateInferenceClassificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInferenceClassificationFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewInferenceClassification(), nil } // GetFieldDeserializers the deserialization information for the current model func (m *InferenceClassification) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["overrides"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewInferenceClassificationOverride() }) + val, err := n.GetCollectionOfObjectValues(CreateInferenceClassificationOverrideFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]InferenceClassificationOverride, len(val)) + res := make([]InferenceClassificationOverrideable, len(val)) for i, v := range val { - res[i] = *(v.(*InferenceClassificationOverride)) + res[i] = v.(InferenceClassificationOverrideable) } m.SetOverrides(res) } @@ -44,6 +40,14 @@ func (m *InferenceClassification) GetFieldDeserializers()(map[string]func(interf } return res } +// GetOverrides gets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. +func (m *InferenceClassification) GetOverrides()([]InferenceClassificationOverrideable) { + if m == nil { + return nil + } else { + return m.overrides + } +} func (m *InferenceClassification) IsNil()(bool) { return m == nil } @@ -56,8 +60,7 @@ func (m *InferenceClassification) Serialize(writer i04eb5309aeaafadd28374d79c847 if m.GetOverrides() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetOverrides())) for i, v := range m.GetOverrides() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("overrides", cast) if err != nil { @@ -67,7 +70,7 @@ func (m *InferenceClassification) Serialize(writer i04eb5309aeaafadd28374d79c847 return nil } // SetOverrides sets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassification) SetOverrides(value []InferenceClassificationOverride)() { +func (m *InferenceClassification) SetOverrides(value []InferenceClassificationOverrideable)() { if m != nil { m.overrides = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_override.go b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_override.go index 62f0719d0..59670c4ea 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_override.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_override.go @@ -10,7 +10,7 @@ type InferenceClassificationOverride struct { // classifyAs *InferenceClassificationType; // - senderEmailAddress *EmailAddress; + senderEmailAddress EmailAddressable; } // NewInferenceClassificationOverride instantiates a new inferenceClassificationOverride and sets the default values. func NewInferenceClassificationOverride()(*InferenceClassificationOverride) { @@ -19,6 +19,10 @@ func NewInferenceClassificationOverride()(*InferenceClassificationOverride) { } return m } +// CreateInferenceClassificationOverrideFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInferenceClassificationOverrideFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewInferenceClassificationOverride(), nil +} // GetClassifyAs gets the classifyAs property value. func (m *InferenceClassificationOverride) GetClassifyAs()(*InferenceClassificationType) { if m == nil { @@ -27,14 +31,6 @@ func (m *InferenceClassificationOverride) GetClassifyAs()(*InferenceClassificati return m.classifyAs } } -// GetSenderEmailAddress gets the senderEmailAddress property value. -func (m *InferenceClassificationOverride) GetSenderEmailAddress()(*EmailAddress) { - if m == nil { - return nil - } else { - return m.senderEmailAddress - } -} // GetFieldDeserializers the deserialization information for the current model func (m *InferenceClassificationOverride) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() @@ -49,17 +45,25 @@ func (m *InferenceClassificationOverride) GetFieldDeserializers()(map[string]fun return nil } res["senderEmailAddress"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewEmailAddress() }) + val, err := n.GetObjectValue(CreateEmailAddressFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetSenderEmailAddress(val.(*EmailAddress)) + m.SetSenderEmailAddress(val.(EmailAddressable)) } return nil } return res } +// GetSenderEmailAddress gets the senderEmailAddress property value. +func (m *InferenceClassificationOverride) GetSenderEmailAddress()(EmailAddressable) { + if m == nil { + return nil + } else { + return m.senderEmailAddress + } +} func (m *InferenceClassificationOverride) IsNil()(bool) { return m == nil } @@ -91,7 +95,7 @@ func (m *InferenceClassificationOverride) SetClassifyAs(value *InferenceClassifi } } // SetSenderEmailAddress sets the senderEmailAddress property value. -func (m *InferenceClassificationOverride) SetSenderEmailAddress(value *EmailAddress)() { +func (m *InferenceClassificationOverride) SetSenderEmailAddress(value EmailAddressable)() { if m != nil { m.senderEmailAddress = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_overrideable.go b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_overrideable.go new file mode 100644 index 000000000..b7b1c3e97 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classification_overrideable.go @@ -0,0 +1,9 @@ +package graph +// InferenceClassificationOverrideable +type InferenceClassificationOverrideable interface { + Entityable + GetClassifyAs()(*InferenceClassificationType) + GetSenderEmailAddress()(EmailAddressable) + SetClassifyAs(value *InferenceClassificationType)() + SetSenderEmailAddress(value EmailAddressable)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/inference_classificationable.go b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classificationable.go new file mode 100644 index 000000000..a3a156a36 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/inference_classificationable.go @@ -0,0 +1,7 @@ +package graph +// InferenceClassificationable +type InferenceClassificationable interface { + Entityable + GetOverrides()([]InferenceClassificationOverrideable) + SetOverrides(value []InferenceClassificationOverrideable)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_header.go b/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_header.go index 3163600b8..687bb6543 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_header.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_header.go @@ -20,6 +20,10 @@ func NewInternetMessageHeader()(*InternetMessageHeader) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateInternetMessageHeaderFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInternetMessageHeaderFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewInternetMessageHeader(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *InternetMessageHeader) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -28,22 +32,6 @@ func (m *InternetMessageHeader) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetName gets the name property value. Represents the key in a key-value pair. -func (m *InternetMessageHeader) GetName()(*string) { - if m == nil { - return nil - } else { - return m.name - } -} -// GetValue gets the value property value. The value in a key-value pair. -func (m *InternetMessageHeader) GetValue()(*string) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *InternetMessageHeader) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -69,6 +57,22 @@ func (m *InternetMessageHeader) GetFieldDeserializers()(map[string]func(interfac } return res } +// GetName gets the name property value. Represents the key in a key-value pair. +func (m *InternetMessageHeader) GetName()(*string) { + if m == nil { + return nil + } else { + return m.name + } +} +// GetValue gets the value property value. The value in a key-value pair. +func (m *InternetMessageHeader) GetValue()(*string) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *InternetMessageHeader) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_headerable.go b/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_headerable.go new file mode 100644 index 000000000..6b7349474 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/internet_message_headerable.go @@ -0,0 +1,14 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// InternetMessageHeaderable +type InternetMessageHeaderable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/item_body.go b/msgraph-mail/go/utilities/models/microsoft/graph/item_body.go index 713dd6483..a8026fdf1 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/item_body.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/item_body.go @@ -20,6 +20,10 @@ func NewItemBody()(*ItemBody) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateItemBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemBodyFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewItemBody(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *ItemBody) GetAdditionalData()(map[string]interface{}) { if m == nil { diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/item_bodyable.go b/msgraph-mail/go/utilities/models/microsoft/graph/item_bodyable.go new file mode 100644 index 000000000..c7ca5fe69 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/item_bodyable.go @@ -0,0 +1,14 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// ItemBodyable +type ItemBodyable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetContent()(*string) + GetContentType()(*BodyType) + SetContent(value *string)() + SetContentType(value *BodyType)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/mail_folder.go b/msgraph-mail/go/utilities/models/microsoft/graph/mail_folder.go index 3e8a96883..b5be6c0c8 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/mail_folder.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/mail_folder.go @@ -10,21 +10,21 @@ type MailFolder struct { // The number of immediate child mailFolders in the current mailFolder. childFolderCount *int32; // The collection of child folders in the mailFolder. - childFolders []MailFolder; + childFolders []MailFolderable; // The mailFolder's display name. displayName *string; // Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. isHidden *bool; // The collection of rules that apply to the user's Inbox folder. - messageRules []MessageRule; + messageRules []MessageRuleable; // The collection of messages in the mailFolder. - messages []Message; + messages []Messageable; // The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. - multiValueExtendedProperties []MultiValueLegacyExtendedProperty; + multiValueExtendedProperties []MultiValueLegacyExtendedPropertyable; // The unique identifier for the mailFolder's parent mailFolder. parentFolderId *string; // The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. - singleValueExtendedProperties []SingleValueLegacyExtendedProperty; + singleValueExtendedProperties []SingleValueLegacyExtendedPropertyable; // The number of items in the mailFolder. totalItemCount *int32; // The number of items in the mailFolder marked as unread. @@ -37,6 +37,10 @@ func NewMailFolder()(*MailFolder) { } return m } +// CreateMailFolderFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMailFolderFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMailFolder(), nil +} // GetChildFolderCount gets the childFolderCount property value. The number of immediate child mailFolders in the current mailFolder. func (m *MailFolder) GetChildFolderCount()(*int32) { if m == nil { @@ -46,7 +50,7 @@ func (m *MailFolder) GetChildFolderCount()(*int32) { } } // GetChildFolders gets the childFolders property value. The collection of child folders in the mailFolder. -func (m *MailFolder) GetChildFolders()([]MailFolder) { +func (m *MailFolder) GetChildFolders()([]MailFolderable) { if m == nil { return nil } else { @@ -61,70 +65,6 @@ func (m *MailFolder) GetDisplayName()(*string) { return m.displayName } } -// GetIsHidden gets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. -func (m *MailFolder) GetIsHidden()(*bool) { - if m == nil { - return nil - } else { - return m.isHidden - } -} -// GetMessageRules gets the messageRules property value. The collection of rules that apply to the user's Inbox folder. -func (m *MailFolder) GetMessageRules()([]MessageRule) { - if m == nil { - return nil - } else { - return m.messageRules - } -} -// GetMessages gets the messages property value. The collection of messages in the mailFolder. -func (m *MailFolder) GetMessages()([]Message) { - if m == nil { - return nil - } else { - return m.messages - } -} -// GetMultiValueExtendedProperties gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MailFolder) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.multiValueExtendedProperties - } -} -// GetParentFolderId gets the parentFolderId property value. The unique identifier for the mailFolder's parent mailFolder. -func (m *MailFolder) GetParentFolderId()(*string) { - if m == nil { - return nil - } else { - return m.parentFolderId - } -} -// GetSingleValueExtendedProperties gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MailFolder) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.singleValueExtendedProperties - } -} -// GetTotalItemCount gets the totalItemCount property value. The number of items in the mailFolder. -func (m *MailFolder) GetTotalItemCount()(*int32) { - if m == nil { - return nil - } else { - return m.totalItemCount - } -} -// GetUnreadItemCount gets the unreadItemCount property value. The number of items in the mailFolder marked as unread. -func (m *MailFolder) GetUnreadItemCount()(*int32) { - if m == nil { - return nil - } else { - return m.unreadItemCount - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MailFolder) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() @@ -139,14 +79,14 @@ func (m *MailFolder) GetFieldDeserializers()(map[string]func(interface{}, i04eb5 return nil } res["childFolders"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMailFolder() }) + val, err := n.GetCollectionOfObjectValues(CreateMailFolderFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]MailFolder, len(val)) + res := make([]MailFolderable, len(val)) for i, v := range val { - res[i] = *(v.(*MailFolder)) + res[i] = v.(MailFolderable) } m.SetChildFolders(res) } @@ -173,42 +113,42 @@ func (m *MailFolder) GetFieldDeserializers()(map[string]func(interface{}, i04eb5 return nil } res["messageRules"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessageRule() }) + val, err := n.GetCollectionOfObjectValues(CreateMessageRuleFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]MessageRule, len(val)) + res := make([]MessageRuleable, len(val)) for i, v := range val { - res[i] = *(v.(*MessageRule)) + res[i] = v.(MessageRuleable) } m.SetMessageRules(res) } return nil } res["messages"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessage() }) + val, err := n.GetCollectionOfObjectValues(CreateMessageFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Message, len(val)) + res := make([]Messageable, len(val)) for i, v := range val { - res[i] = *(v.(*Message)) + res[i] = v.(Messageable) } m.SetMessages(res) } return nil } res["multiValueExtendedProperties"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMultiValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]MultiValueLegacyExtendedProperty, len(val)) + res := make([]MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*MultiValueLegacyExtendedProperty)) + res[i] = v.(MultiValueLegacyExtendedPropertyable) } m.SetMultiValueExtendedProperties(res) } @@ -225,14 +165,14 @@ func (m *MailFolder) GetFieldDeserializers()(map[string]func(interface{}, i04eb5 return nil } res["singleValueExtendedProperties"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSingleValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]SingleValueLegacyExtendedProperty, len(val)) + res := make([]SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*SingleValueLegacyExtendedProperty)) + res[i] = v.(SingleValueLegacyExtendedPropertyable) } m.SetSingleValueExtendedProperties(res) } @@ -260,6 +200,70 @@ func (m *MailFolder) GetFieldDeserializers()(map[string]func(interface{}, i04eb5 } return res } +// GetIsHidden gets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. +func (m *MailFolder) GetIsHidden()(*bool) { + if m == nil { + return nil + } else { + return m.isHidden + } +} +// GetMessageRules gets the messageRules property value. The collection of rules that apply to the user's Inbox folder. +func (m *MailFolder) GetMessageRules()([]MessageRuleable) { + if m == nil { + return nil + } else { + return m.messageRules + } +} +// GetMessages gets the messages property value. The collection of messages in the mailFolder. +func (m *MailFolder) GetMessages()([]Messageable) { + if m == nil { + return nil + } else { + return m.messages + } +} +// GetMultiValueExtendedProperties gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. +func (m *MailFolder) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.multiValueExtendedProperties + } +} +// GetParentFolderId gets the parentFolderId property value. The unique identifier for the mailFolder's parent mailFolder. +func (m *MailFolder) GetParentFolderId()(*string) { + if m == nil { + return nil + } else { + return m.parentFolderId + } +} +// GetSingleValueExtendedProperties gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. +func (m *MailFolder) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.singleValueExtendedProperties + } +} +// GetTotalItemCount gets the totalItemCount property value. The number of items in the mailFolder. +func (m *MailFolder) GetTotalItemCount()(*int32) { + if m == nil { + return nil + } else { + return m.totalItemCount + } +} +// GetUnreadItemCount gets the unreadItemCount property value. The number of items in the mailFolder marked as unread. +func (m *MailFolder) GetUnreadItemCount()(*int32) { + if m == nil { + return nil + } else { + return m.unreadItemCount + } +} func (m *MailFolder) IsNil()(bool) { return m == nil } @@ -278,8 +282,7 @@ func (m *MailFolder) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4 if m.GetChildFolders() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetChildFolders())) for i, v := range m.GetChildFolders() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("childFolders", cast) if err != nil { @@ -301,8 +304,7 @@ func (m *MailFolder) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4 if m.GetMessageRules() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetMessageRules())) for i, v := range m.GetMessageRules() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("messageRules", cast) if err != nil { @@ -312,8 +314,7 @@ func (m *MailFolder) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4 if m.GetMessages() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetMessages())) for i, v := range m.GetMessages() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("messages", cast) if err != nil { @@ -323,8 +324,7 @@ func (m *MailFolder) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4 if m.GetMultiValueExtendedProperties() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetMultiValueExtendedProperties())) for i, v := range m.GetMultiValueExtendedProperties() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("multiValueExtendedProperties", cast) if err != nil { @@ -340,8 +340,7 @@ func (m *MailFolder) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4 if m.GetSingleValueExtendedProperties() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetSingleValueExtendedProperties())) for i, v := range m.GetSingleValueExtendedProperties() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("singleValueExtendedProperties", cast) if err != nil { @@ -369,7 +368,7 @@ func (m *MailFolder) SetChildFolderCount(value *int32)() { } } // SetChildFolders sets the childFolders property value. The collection of child folders in the mailFolder. -func (m *MailFolder) SetChildFolders(value []MailFolder)() { +func (m *MailFolder) SetChildFolders(value []MailFolderable)() { if m != nil { m.childFolders = value } @@ -387,19 +386,19 @@ func (m *MailFolder) SetIsHidden(value *bool)() { } } // SetMessageRules sets the messageRules property value. The collection of rules that apply to the user's Inbox folder. -func (m *MailFolder) SetMessageRules(value []MessageRule)() { +func (m *MailFolder) SetMessageRules(value []MessageRuleable)() { if m != nil { m.messageRules = value } } // SetMessages sets the messages property value. The collection of messages in the mailFolder. -func (m *MailFolder) SetMessages(value []Message)() { +func (m *MailFolder) SetMessages(value []Messageable)() { if m != nil { m.messages = value } } // SetMultiValueExtendedProperties sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MailFolder) SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedProperty)() { +func (m *MailFolder) SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() { if m != nil { m.multiValueExtendedProperties = value } @@ -411,7 +410,7 @@ func (m *MailFolder) SetParentFolderId(value *string)() { } } // SetSingleValueExtendedProperties sets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MailFolder) SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedProperty)() { +func (m *MailFolder) SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() { if m != nil { m.singleValueExtendedProperties = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/mail_folderable.go b/msgraph-mail/go/utilities/models/microsoft/graph/mail_folderable.go new file mode 100644 index 000000000..9b13e3708 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/mail_folderable.go @@ -0,0 +1,27 @@ +package graph +// MailFolderable +type MailFolderable interface { + Entityable + GetChildFolderCount()(*int32) + GetChildFolders()([]MailFolderable) + GetDisplayName()(*string) + GetIsHidden()(*bool) + GetMessageRules()([]MessageRuleable) + GetMessages()([]Messageable) + GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) + GetParentFolderId()(*string) + GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) + GetTotalItemCount()(*int32) + GetUnreadItemCount()(*int32) + SetChildFolderCount(value *int32)() + SetChildFolders(value []MailFolderable)() + SetDisplayName(value *string)() + SetIsHidden(value *bool)() + SetMessageRules(value []MessageRuleable)() + SetMessages(value []Messageable)() + SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() + SetParentFolderId(value *string)() + SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() + SetTotalItemCount(value *int32)() + SetUnreadItemCount(value *int32)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message.go b/msgraph-mail/go/utilities/models/microsoft/graph/message.go index 3e0d18005..906d58749 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/message.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message.go @@ -9,25 +9,25 @@ import ( type Message struct { OutlookItem // The fileAttachment and itemAttachment attachments for the message. - attachments []Attachment; + attachments []Attachmentable; // The Bcc: recipients for the message. - bccRecipients []Recipient; + bccRecipients []Recipientable; // - body *ItemBody; - // 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. + body ItemBodyable; + // The first 255 characters of the message body. It is in text format. bodyPreview *string; // The Cc: recipients for the message. - ccRecipients []Recipient; + ccRecipients []Recipientable; // The ID of the conversation the email belongs to. conversationId *string; // Indicates the position of the message within the conversation. conversationIndex []byte; // The collection of open extensions defined for the message. Nullable. - extensions []Extension; + extensions []Extensionable; // - flag *FollowupFlag; + flag FollowupFlagable; // - from *Recipient; + from Recipientable; // Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . hasAttachments *bool; // @@ -35,7 +35,7 @@ type Message struct { // inferenceClassification *InferenceClassificationType; // - internetMessageHeaders []InternetMessageHeader; + internetMessageHeaders []InternetMessageHeaderable; // internetMessageId *string; // @@ -47,25 +47,25 @@ type Message struct { // isReadReceiptRequested *bool; // The collection of multi-value extended properties defined for the message. Nullable. - multiValueExtendedProperties []MultiValueLegacyExtendedProperty; + multiValueExtendedProperties []MultiValueLegacyExtendedPropertyable; // parentFolderId *string; // receivedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time; // - replyTo []Recipient; + replyTo []Recipientable; // - sender *Recipient; + sender Recipientable; // sentDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time; // The collection of single-value extended properties defined for the message. Nullable. - singleValueExtendedProperties []SingleValueLegacyExtendedProperty; + singleValueExtendedProperties []SingleValueLegacyExtendedPropertyable; // subject *string; // - toRecipients []Recipient; + toRecipients []Recipientable; // - uniqueBody *ItemBody; + uniqueBody ItemBodyable; // webLink *string; } @@ -76,8 +76,12 @@ func NewMessage()(*Message) { } return m } +// CreateMessageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessageFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessage(), nil +} // GetAttachments gets the attachments property value. The fileAttachment and itemAttachment attachments for the message. -func (m *Message) GetAttachments()([]Attachment) { +func (m *Message) GetAttachments()([]Attachmentable) { if m == nil { return nil } else { @@ -85,7 +89,7 @@ func (m *Message) GetAttachments()([]Attachment) { } } // GetBccRecipients gets the bccRecipients property value. The Bcc: recipients for the message. -func (m *Message) GetBccRecipients()([]Recipient) { +func (m *Message) GetBccRecipients()([]Recipientable) { if m == nil { return nil } else { @@ -93,14 +97,14 @@ func (m *Message) GetBccRecipients()([]Recipient) { } } // GetBody gets the body property value. -func (m *Message) GetBody()(*ItemBody) { +func (m *Message) GetBody()(ItemBodyable) { if m == nil { return nil } else { return m.body } } -// GetBodyPreview gets the bodyPreview property value. 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. +// GetBodyPreview gets the bodyPreview property value. The first 255 characters of the message body. It is in text format. func (m *Message) GetBodyPreview()(*string) { if m == nil { return nil @@ -109,7 +113,7 @@ func (m *Message) GetBodyPreview()(*string) { } } // GetCcRecipients gets the ccRecipients property value. The Cc: recipients for the message. -func (m *Message) GetCcRecipients()([]Recipient) { +func (m *Message) GetCcRecipients()([]Recipientable) { if m == nil { return nil } else { @@ -133,227 +137,51 @@ func (m *Message) GetConversationIndex()([]byte) { } } // GetExtensions gets the extensions property value. The collection of open extensions defined for the message. Nullable. -func (m *Message) GetExtensions()([]Extension) { +func (m *Message) GetExtensions()([]Extensionable) { if m == nil { return nil } else { return m.extensions } } -// GetFlag gets the flag property value. -func (m *Message) GetFlag()(*FollowupFlag) { - if m == nil { - return nil - } else { - return m.flag - } -} -// GetFrom gets the from property value. -func (m *Message) GetFrom()(*Recipient) { - if m == nil { - return nil - } else { - return m.from - } -} -// GetHasAttachments gets the hasAttachments property value. Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . -func (m *Message) GetHasAttachments()(*bool) { - if m == nil { - return nil - } else { - return m.hasAttachments - } -} -// GetImportance gets the importance property value. -func (m *Message) GetImportance()(*Importance) { - if m == nil { - return nil - } else { - return m.importance - } -} -// GetInferenceClassification gets the inferenceClassification property value. -func (m *Message) GetInferenceClassification()(*InferenceClassificationType) { - if m == nil { - return nil - } else { - return m.inferenceClassification - } -} -// GetInternetMessageHeaders gets the internetMessageHeaders property value. -func (m *Message) GetInternetMessageHeaders()([]InternetMessageHeader) { - if m == nil { - return nil - } else { - return m.internetMessageHeaders - } -} -// GetInternetMessageId gets the internetMessageId property value. -func (m *Message) GetInternetMessageId()(*string) { - if m == nil { - return nil - } else { - return m.internetMessageId - } -} -// GetIsDeliveryReceiptRequested gets the isDeliveryReceiptRequested property value. -func (m *Message) GetIsDeliveryReceiptRequested()(*bool) { - if m == nil { - return nil - } else { - return m.isDeliveryReceiptRequested - } -} -// GetIsDraft gets the isDraft property value. -func (m *Message) GetIsDraft()(*bool) { - if m == nil { - return nil - } else { - return m.isDraft - } -} -// GetIsRead gets the isRead property value. -func (m *Message) GetIsRead()(*bool) { - if m == nil { - return nil - } else { - return m.isRead - } -} -// GetIsReadReceiptRequested gets the isReadReceiptRequested property value. -func (m *Message) GetIsReadReceiptRequested()(*bool) { - if m == nil { - return nil - } else { - return m.isReadReceiptRequested - } -} -// GetMultiValueExtendedProperties gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. -func (m *Message) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.multiValueExtendedProperties - } -} -// GetParentFolderId gets the parentFolderId property value. -func (m *Message) GetParentFolderId()(*string) { - if m == nil { - return nil - } else { - return m.parentFolderId - } -} -// GetReceivedDateTime gets the receivedDateTime property value. -func (m *Message) GetReceivedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { - if m == nil { - return nil - } else { - return m.receivedDateTime - } -} -// GetReplyTo gets the replyTo property value. -func (m *Message) GetReplyTo()([]Recipient) { - if m == nil { - return nil - } else { - return m.replyTo - } -} -// GetSender gets the sender property value. -func (m *Message) GetSender()(*Recipient) { - if m == nil { - return nil - } else { - return m.sender - } -} -// GetSentDateTime gets the sentDateTime property value. -func (m *Message) GetSentDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { - if m == nil { - return nil - } else { - return m.sentDateTime - } -} -// GetSingleValueExtendedProperties gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. -func (m *Message) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.singleValueExtendedProperties - } -} -// GetSubject gets the subject property value. -func (m *Message) GetSubject()(*string) { - if m == nil { - return nil - } else { - return m.subject - } -} -// GetToRecipients gets the toRecipients property value. -func (m *Message) GetToRecipients()([]Recipient) { - if m == nil { - return nil - } else { - return m.toRecipients - } -} -// GetUniqueBody gets the uniqueBody property value. -func (m *Message) GetUniqueBody()(*ItemBody) { - if m == nil { - return nil - } else { - return m.uniqueBody - } -} -// GetWebLink gets the webLink property value. -func (m *Message) GetWebLink()(*string) { - if m == nil { - return nil - } else { - return m.webLink - } -} // GetFieldDeserializers the deserialization information for the current model func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.OutlookItem.GetFieldDeserializers() res["attachments"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewAttachment() }) + val, err := n.GetCollectionOfObjectValues(CreateAttachmentFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Attachment, len(val)) + res := make([]Attachmentable, len(val)) for i, v := range val { - res[i] = *(v.(*Attachment)) + res[i] = v.(Attachmentable) } m.SetAttachments(res) } return nil } res["bccRecipients"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetBccRecipients(res) } return nil } res["body"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewItemBody() }) + val, err := n.GetObjectValue(CreateItemBodyFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetBody(val.(*ItemBody)) + m.SetBody(val.(ItemBodyable)) } return nil } @@ -368,14 +196,14 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["ccRecipients"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetCcRecipients(res) } @@ -402,36 +230,36 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["extensions"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewExtension() }) + val, err := n.GetCollectionOfObjectValues(CreateExtensionFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Extension, len(val)) + res := make([]Extensionable, len(val)) for i, v := range val { - res[i] = *(v.(*Extension)) + res[i] = v.(Extensionable) } m.SetExtensions(res) } return nil } res["flag"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewFollowupFlag() }) + val, err := n.GetObjectValue(CreateFollowupFlagFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetFlag(val.(*FollowupFlag)) + m.SetFlag(val.(FollowupFlagable)) } return nil } res["from"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetObjectValue(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetFrom(val.(*Recipient)) + m.SetFrom(val.(Recipientable)) } return nil } @@ -466,14 +294,14 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["internetMessageHeaders"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewInternetMessageHeader() }) + val, err := n.GetCollectionOfObjectValues(CreateInternetMessageHeaderFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]InternetMessageHeader, len(val)) + res := make([]InternetMessageHeaderable, len(val)) for i, v := range val { - res[i] = *(v.(*InternetMessageHeader)) + res[i] = v.(InternetMessageHeaderable) } m.SetInternetMessageHeaders(res) } @@ -530,14 +358,14 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["multiValueExtendedProperties"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMultiValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]MultiValueLegacyExtendedProperty, len(val)) + res := make([]MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*MultiValueLegacyExtendedProperty)) + res[i] = v.(MultiValueLegacyExtendedPropertyable) } m.SetMultiValueExtendedProperties(res) } @@ -564,26 +392,26 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["replyTo"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetReplyTo(res) } return nil } res["sender"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetObjectValue(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetSender(val.(*Recipient)) + m.SetSender(val.(Recipientable)) } return nil } @@ -598,14 +426,14 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["singleValueExtendedProperties"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSingleValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]SingleValueLegacyExtendedProperty, len(val)) + res := make([]SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*SingleValueLegacyExtendedProperty)) + res[i] = v.(SingleValueLegacyExtendedPropertyable) } m.SetSingleValueExtendedProperties(res) } @@ -622,26 +450,26 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 return nil } res["toRecipients"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetToRecipients(res) } return nil } res["uniqueBody"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewItemBody() }) + val, err := n.GetObjectValue(CreateItemBodyFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetUniqueBody(val.(*ItemBody)) + m.SetUniqueBody(val.(ItemBodyable)) } return nil } @@ -657,6 +485,182 @@ func (m *Message) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309 } return res } +// GetFlag gets the flag property value. +func (m *Message) GetFlag()(FollowupFlagable) { + if m == nil { + return nil + } else { + return m.flag + } +} +// GetFrom gets the from property value. +func (m *Message) GetFrom()(Recipientable) { + if m == nil { + return nil + } else { + return m.from + } +} +// GetHasAttachments gets the hasAttachments property value. Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . +func (m *Message) GetHasAttachments()(*bool) { + if m == nil { + return nil + } else { + return m.hasAttachments + } +} +// GetImportance gets the importance property value. +func (m *Message) GetImportance()(*Importance) { + if m == nil { + return nil + } else { + return m.importance + } +} +// GetInferenceClassification gets the inferenceClassification property value. +func (m *Message) GetInferenceClassification()(*InferenceClassificationType) { + if m == nil { + return nil + } else { + return m.inferenceClassification + } +} +// GetInternetMessageHeaders gets the internetMessageHeaders property value. +func (m *Message) GetInternetMessageHeaders()([]InternetMessageHeaderable) { + if m == nil { + return nil + } else { + return m.internetMessageHeaders + } +} +// GetInternetMessageId gets the internetMessageId property value. +func (m *Message) GetInternetMessageId()(*string) { + if m == nil { + return nil + } else { + return m.internetMessageId + } +} +// GetIsDeliveryReceiptRequested gets the isDeliveryReceiptRequested property value. +func (m *Message) GetIsDeliveryReceiptRequested()(*bool) { + if m == nil { + return nil + } else { + return m.isDeliveryReceiptRequested + } +} +// GetIsDraft gets the isDraft property value. +func (m *Message) GetIsDraft()(*bool) { + if m == nil { + return nil + } else { + return m.isDraft + } +} +// GetIsRead gets the isRead property value. +func (m *Message) GetIsRead()(*bool) { + if m == nil { + return nil + } else { + return m.isRead + } +} +// GetIsReadReceiptRequested gets the isReadReceiptRequested property value. +func (m *Message) GetIsReadReceiptRequested()(*bool) { + if m == nil { + return nil + } else { + return m.isReadReceiptRequested + } +} +// GetMultiValueExtendedProperties gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. +func (m *Message) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.multiValueExtendedProperties + } +} +// GetParentFolderId gets the parentFolderId property value. +func (m *Message) GetParentFolderId()(*string) { + if m == nil { + return nil + } else { + return m.parentFolderId + } +} +// GetReceivedDateTime gets the receivedDateTime property value. +func (m *Message) GetReceivedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + if m == nil { + return nil + } else { + return m.receivedDateTime + } +} +// GetReplyTo gets the replyTo property value. +func (m *Message) GetReplyTo()([]Recipientable) { + if m == nil { + return nil + } else { + return m.replyTo + } +} +// GetSender gets the sender property value. +func (m *Message) GetSender()(Recipientable) { + if m == nil { + return nil + } else { + return m.sender + } +} +// GetSentDateTime gets the sentDateTime property value. +func (m *Message) GetSentDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + if m == nil { + return nil + } else { + return m.sentDateTime + } +} +// GetSingleValueExtendedProperties gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. +func (m *Message) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.singleValueExtendedProperties + } +} +// GetSubject gets the subject property value. +func (m *Message) GetSubject()(*string) { + if m == nil { + return nil + } else { + return m.subject + } +} +// GetToRecipients gets the toRecipients property value. +func (m *Message) GetToRecipients()([]Recipientable) { + if m == nil { + return nil + } else { + return m.toRecipients + } +} +// GetUniqueBody gets the uniqueBody property value. +func (m *Message) GetUniqueBody()(ItemBodyable) { + if m == nil { + return nil + } else { + return m.uniqueBody + } +} +// GetWebLink gets the webLink property value. +func (m *Message) GetWebLink()(*string) { + if m == nil { + return nil + } else { + return m.webLink + } +} func (m *Message) IsNil()(bool) { return m == nil } @@ -669,8 +673,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetAttachments() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetAttachments())) for i, v := range m.GetAttachments() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("attachments", cast) if err != nil { @@ -680,8 +683,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetBccRecipients() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetBccRecipients())) for i, v := range m.GetBccRecipients() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("bccRecipients", cast) if err != nil { @@ -703,8 +705,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetCcRecipients() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetCcRecipients())) for i, v := range m.GetCcRecipients() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("ccRecipients", cast) if err != nil { @@ -726,8 +727,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetExtensions() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetExtensions())) for i, v := range m.GetExtensions() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("extensions", cast) if err != nil { @@ -769,8 +769,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetInternetMessageHeaders() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetInternetMessageHeaders())) for i, v := range m.GetInternetMessageHeaders() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("internetMessageHeaders", cast) if err != nil { @@ -810,8 +809,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetMultiValueExtendedProperties() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetMultiValueExtendedProperties())) for i, v := range m.GetMultiValueExtendedProperties() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("multiValueExtendedProperties", cast) if err != nil { @@ -833,8 +831,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetReplyTo() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetReplyTo())) for i, v := range m.GetReplyTo() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("replyTo", cast) if err != nil { @@ -856,8 +853,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetSingleValueExtendedProperties() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetSingleValueExtendedProperties())) for i, v := range m.GetSingleValueExtendedProperties() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("singleValueExtendedProperties", cast) if err != nil { @@ -873,8 +869,7 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 if m.GetToRecipients() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetToRecipients())) for i, v := range m.GetToRecipients() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err = writer.WriteCollectionOfObjectValues("toRecipients", cast) if err != nil { @@ -896,31 +891,31 @@ func (m *Message) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b4dc2 return nil } // SetAttachments sets the attachments property value. The fileAttachment and itemAttachment attachments for the message. -func (m *Message) SetAttachments(value []Attachment)() { +func (m *Message) SetAttachments(value []Attachmentable)() { if m != nil { m.attachments = value } } // SetBccRecipients sets the bccRecipients property value. The Bcc: recipients for the message. -func (m *Message) SetBccRecipients(value []Recipient)() { +func (m *Message) SetBccRecipients(value []Recipientable)() { if m != nil { m.bccRecipients = value } } // SetBody sets the body property value. -func (m *Message) SetBody(value *ItemBody)() { +func (m *Message) SetBody(value ItemBodyable)() { if m != nil { m.body = value } } -// SetBodyPreview sets the bodyPreview property value. 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. +// SetBodyPreview sets the bodyPreview property value. The first 255 characters of the message body. It is in text format. func (m *Message) SetBodyPreview(value *string)() { if m != nil { m.bodyPreview = value } } // SetCcRecipients sets the ccRecipients property value. The Cc: recipients for the message. -func (m *Message) SetCcRecipients(value []Recipient)() { +func (m *Message) SetCcRecipients(value []Recipientable)() { if m != nil { m.ccRecipients = value } @@ -938,19 +933,19 @@ func (m *Message) SetConversationIndex(value []byte)() { } } // SetExtensions sets the extensions property value. The collection of open extensions defined for the message. Nullable. -func (m *Message) SetExtensions(value []Extension)() { +func (m *Message) SetExtensions(value []Extensionable)() { if m != nil { m.extensions = value } } // SetFlag sets the flag property value. -func (m *Message) SetFlag(value *FollowupFlag)() { +func (m *Message) SetFlag(value FollowupFlagable)() { if m != nil { m.flag = value } } // SetFrom sets the from property value. -func (m *Message) SetFrom(value *Recipient)() { +func (m *Message) SetFrom(value Recipientable)() { if m != nil { m.from = value } @@ -974,7 +969,7 @@ func (m *Message) SetInferenceClassification(value *InferenceClassificationType) } } // SetInternetMessageHeaders sets the internetMessageHeaders property value. -func (m *Message) SetInternetMessageHeaders(value []InternetMessageHeader)() { +func (m *Message) SetInternetMessageHeaders(value []InternetMessageHeaderable)() { if m != nil { m.internetMessageHeaders = value } @@ -1010,7 +1005,7 @@ func (m *Message) SetIsReadReceiptRequested(value *bool)() { } } // SetMultiValueExtendedProperties sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. -func (m *Message) SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedProperty)() { +func (m *Message) SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() { if m != nil { m.multiValueExtendedProperties = value } @@ -1028,13 +1023,13 @@ func (m *Message) SetReceivedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6 } } // SetReplyTo sets the replyTo property value. -func (m *Message) SetReplyTo(value []Recipient)() { +func (m *Message) SetReplyTo(value []Recipientable)() { if m != nil { m.replyTo = value } } // SetSender sets the sender property value. -func (m *Message) SetSender(value *Recipient)() { +func (m *Message) SetSender(value Recipientable)() { if m != nil { m.sender = value } @@ -1046,7 +1041,7 @@ func (m *Message) SetSentDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f307 } } // SetSingleValueExtendedProperties sets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. -func (m *Message) SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedProperty)() { +func (m *Message) SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() { if m != nil { m.singleValueExtendedProperties = value } @@ -1058,13 +1053,13 @@ func (m *Message) SetSubject(value *string)() { } } // SetToRecipients sets the toRecipients property value. -func (m *Message) SetToRecipients(value []Recipient)() { +func (m *Message) SetToRecipients(value []Recipientable)() { if m != nil { m.toRecipients = value } } // SetUniqueBody sets the uniqueBody property value. -func (m *Message) SetUniqueBody(value *ItemBody)() { +func (m *Message) SetUniqueBody(value ItemBodyable)() { if m != nil { m.uniqueBody = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule.go index cd6563244..2020a73e4 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule.go @@ -8,13 +8,13 @@ import ( type MessageRule struct { Entity // - actions *MessageRuleActions; + actions MessageRuleActionsable; // - conditions *MessageRulePredicates; + conditions MessageRulePredicatesable; // The display name of the rule. displayName *string; // - exceptions *MessageRulePredicates; + exceptions MessageRulePredicatesable; // Indicates whether the rule is in an error condition. Read-only. hasError *bool; // Indicates whether the rule is enabled to be applied to messages. @@ -31,8 +31,12 @@ func NewMessageRule()(*MessageRule) { } return m } +// CreateMessageRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessageRuleFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessageRule(), nil +} // GetActions gets the actions property value. -func (m *MessageRule) GetActions()(*MessageRuleActions) { +func (m *MessageRule) GetActions()(MessageRuleActionsable) { if m == nil { return nil } else { @@ -40,7 +44,7 @@ func (m *MessageRule) GetActions()(*MessageRuleActions) { } } // GetConditions gets the conditions property value. -func (m *MessageRule) GetConditions()(*MessageRulePredicates) { +func (m *MessageRule) GetConditions()(MessageRulePredicatesable) { if m == nil { return nil } else { @@ -56,65 +60,33 @@ func (m *MessageRule) GetDisplayName()(*string) { } } // GetExceptions gets the exceptions property value. -func (m *MessageRule) GetExceptions()(*MessageRulePredicates) { +func (m *MessageRule) GetExceptions()(MessageRulePredicatesable) { if m == nil { return nil } else { return m.exceptions } } -// GetHasError gets the hasError property value. Indicates whether the rule is in an error condition. Read-only. -func (m *MessageRule) GetHasError()(*bool) { - if m == nil { - return nil - } else { - return m.hasError - } -} -// GetIsEnabled gets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages. -func (m *MessageRule) GetIsEnabled()(*bool) { - if m == nil { - return nil - } else { - return m.isEnabled - } -} -// GetIsReadOnly gets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. -func (m *MessageRule) GetIsReadOnly()(*bool) { - if m == nil { - return nil - } else { - return m.isReadOnly - } -} -// GetSequence gets the sequence property value. Indicates the order in which the rule is executed, among other rules. -func (m *MessageRule) GetSequence()(*int32) { - if m == nil { - return nil - } else { - return m.sequence - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessageRule) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["actions"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessageRuleActions() }) + val, err := n.GetObjectValue(CreateMessageRuleActionsFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetActions(val.(*MessageRuleActions)) + m.SetActions(val.(MessageRuleActionsable)) } return nil } res["conditions"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessageRulePredicates() }) + val, err := n.GetObjectValue(CreateMessageRulePredicatesFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetConditions(val.(*MessageRulePredicates)) + m.SetConditions(val.(MessageRulePredicatesable)) } return nil } @@ -129,12 +101,12 @@ func (m *MessageRule) GetFieldDeserializers()(map[string]func(interface{}, i04eb return nil } res["exceptions"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessageRulePredicates() }) + val, err := n.GetObjectValue(CreateMessageRulePredicatesFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetExceptions(val.(*MessageRulePredicates)) + m.SetExceptions(val.(MessageRulePredicatesable)) } return nil } @@ -180,6 +152,38 @@ func (m *MessageRule) GetFieldDeserializers()(map[string]func(interface{}, i04eb } return res } +// GetHasError gets the hasError property value. Indicates whether the rule is in an error condition. Read-only. +func (m *MessageRule) GetHasError()(*bool) { + if m == nil { + return nil + } else { + return m.hasError + } +} +// GetIsEnabled gets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages. +func (m *MessageRule) GetIsEnabled()(*bool) { + if m == nil { + return nil + } else { + return m.isEnabled + } +} +// GetIsReadOnly gets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. +func (m *MessageRule) GetIsReadOnly()(*bool) { + if m == nil { + return nil + } else { + return m.isReadOnly + } +} +// GetSequence gets the sequence property value. Indicates the order in which the rule is executed, among other rules. +func (m *MessageRule) GetSequence()(*int32) { + if m == nil { + return nil + } else { + return m.sequence + } +} func (m *MessageRule) IsNil()(bool) { return m == nil } @@ -240,13 +244,13 @@ func (m *MessageRule) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b267510b return nil } // SetActions sets the actions property value. -func (m *MessageRule) SetActions(value *MessageRuleActions)() { +func (m *MessageRule) SetActions(value MessageRuleActionsable)() { if m != nil { m.actions = value } } // SetConditions sets the conditions property value. -func (m *MessageRule) SetConditions(value *MessageRulePredicates)() { +func (m *MessageRule) SetConditions(value MessageRulePredicatesable)() { if m != nil { m.conditions = value } @@ -258,7 +262,7 @@ func (m *MessageRule) SetDisplayName(value *string)() { } } // SetExceptions sets the exceptions property value. -func (m *MessageRule) SetExceptions(value *MessageRulePredicates)() { +func (m *MessageRule) SetExceptions(value MessageRulePredicatesable)() { if m != nil { m.exceptions = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actions.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actions.go index af0a85b8c..00327eb88 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actions.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actions.go @@ -15,9 +15,9 @@ type MessageRuleActions struct { // Indicates whether a message should be moved to the Deleted Items folder. delete *bool; // The email addresses of the recipients to which a message should be forwarded as an attachment. - forwardAsAttachmentTo []Recipient; + forwardAsAttachmentTo []Recipientable; // The email addresses of the recipients to which a message should be forwarded. - forwardTo []Recipient; + forwardTo []Recipientable; // Indicates whether a message should be marked as read. markAsRead *bool; // @@ -26,8 +26,8 @@ type MessageRuleActions struct { moveToFolder *string; // Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. permanentDelete *bool; - // The email address to which a message should be redirected. - redirectTo []Recipient; + // The email addresses to which a message should be redirected. + redirectTo []Recipientable; // Indicates whether subsequent rules should be evaluated. stopProcessingRules *bool; } @@ -38,6 +38,10 @@ func NewMessageRuleActions()(*MessageRuleActions) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMessageRuleActionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessageRuleActionsFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessageRuleActions(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MessageRuleActions) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -70,70 +74,6 @@ func (m *MessageRuleActions) GetDelete()(*bool) { return m.delete } } -// GetForwardAsAttachmentTo gets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. -func (m *MessageRuleActions) GetForwardAsAttachmentTo()([]Recipient) { - if m == nil { - return nil - } else { - return m.forwardAsAttachmentTo - } -} -// GetForwardTo gets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. -func (m *MessageRuleActions) GetForwardTo()([]Recipient) { - if m == nil { - return nil - } else { - return m.forwardTo - } -} -// GetMarkAsRead gets the markAsRead property value. Indicates whether a message should be marked as read. -func (m *MessageRuleActions) GetMarkAsRead()(*bool) { - if m == nil { - return nil - } else { - return m.markAsRead - } -} -// GetMarkImportance gets the markImportance property value. -func (m *MessageRuleActions) GetMarkImportance()(*Importance) { - if m == nil { - return nil - } else { - return m.markImportance - } -} -// GetMoveToFolder gets the moveToFolder property value. The ID of the folder that a message will be moved to. -func (m *MessageRuleActions) GetMoveToFolder()(*string) { - if m == nil { - return nil - } else { - return m.moveToFolder - } -} -// GetPermanentDelete gets the permanentDelete property value. Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. -func (m *MessageRuleActions) GetPermanentDelete()(*bool) { - if m == nil { - return nil - } else { - return m.permanentDelete - } -} -// GetRedirectTo gets the redirectTo property value. The email address to which a message should be redirected. -func (m *MessageRuleActions) GetRedirectTo()([]Recipient) { - if m == nil { - return nil - } else { - return m.redirectTo - } -} -// GetStopProcessingRules gets the stopProcessingRules property value. Indicates whether subsequent rules should be evaluated. -func (m *MessageRuleActions) GetStopProcessingRules()(*bool) { - if m == nil { - return nil - } else { - return m.stopProcessingRules - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessageRuleActions) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -172,28 +112,28 @@ func (m *MessageRuleActions) GetFieldDeserializers()(map[string]func(interface{} return nil } res["forwardAsAttachmentTo"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetForwardAsAttachmentTo(res) } return nil } res["forwardTo"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetForwardTo(res) } @@ -240,14 +180,14 @@ func (m *MessageRuleActions) GetFieldDeserializers()(map[string]func(interface{} return nil } res["redirectTo"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetRedirectTo(res) } @@ -265,6 +205,70 @@ func (m *MessageRuleActions) GetFieldDeserializers()(map[string]func(interface{} } return res } +// GetForwardAsAttachmentTo gets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. +func (m *MessageRuleActions) GetForwardAsAttachmentTo()([]Recipientable) { + if m == nil { + return nil + } else { + return m.forwardAsAttachmentTo + } +} +// GetForwardTo gets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. +func (m *MessageRuleActions) GetForwardTo()([]Recipientable) { + if m == nil { + return nil + } else { + return m.forwardTo + } +} +// GetMarkAsRead gets the markAsRead property value. Indicates whether a message should be marked as read. +func (m *MessageRuleActions) GetMarkAsRead()(*bool) { + if m == nil { + return nil + } else { + return m.markAsRead + } +} +// GetMarkImportance gets the markImportance property value. +func (m *MessageRuleActions) GetMarkImportance()(*Importance) { + if m == nil { + return nil + } else { + return m.markImportance + } +} +// GetMoveToFolder gets the moveToFolder property value. The ID of the folder that a message will be moved to. +func (m *MessageRuleActions) GetMoveToFolder()(*string) { + if m == nil { + return nil + } else { + return m.moveToFolder + } +} +// GetPermanentDelete gets the permanentDelete property value. Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. +func (m *MessageRuleActions) GetPermanentDelete()(*bool) { + if m == nil { + return nil + } else { + return m.permanentDelete + } +} +// GetRedirectTo gets the redirectTo property value. The email addresses to which a message should be redirected. +func (m *MessageRuleActions) GetRedirectTo()([]Recipientable) { + if m == nil { + return nil + } else { + return m.redirectTo + } +} +// GetStopProcessingRules gets the stopProcessingRules property value. Indicates whether subsequent rules should be evaluated. +func (m *MessageRuleActions) GetStopProcessingRules()(*bool) { + if m == nil { + return nil + } else { + return m.stopProcessingRules + } +} func (m *MessageRuleActions) IsNil()(bool) { return m == nil } @@ -291,8 +295,7 @@ func (m *MessageRuleActions) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b if m.GetForwardAsAttachmentTo() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetForwardAsAttachmentTo())) for i, v := range m.GetForwardAsAttachmentTo() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("forwardAsAttachmentTo", cast) if err != nil { @@ -302,8 +305,7 @@ func (m *MessageRuleActions) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b if m.GetForwardTo() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetForwardTo())) for i, v := range m.GetForwardTo() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("forwardTo", cast) if err != nil { @@ -338,8 +340,7 @@ func (m *MessageRuleActions) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b if m.GetRedirectTo() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetRedirectTo())) for i, v := range m.GetRedirectTo() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("redirectTo", cast) if err != nil { @@ -385,13 +386,13 @@ func (m *MessageRuleActions) SetDelete(value *bool)() { } } // SetForwardAsAttachmentTo sets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. -func (m *MessageRuleActions) SetForwardAsAttachmentTo(value []Recipient)() { +func (m *MessageRuleActions) SetForwardAsAttachmentTo(value []Recipientable)() { if m != nil { m.forwardAsAttachmentTo = value } } // SetForwardTo sets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. -func (m *MessageRuleActions) SetForwardTo(value []Recipient)() { +func (m *MessageRuleActions) SetForwardTo(value []Recipientable)() { if m != nil { m.forwardTo = value } @@ -420,8 +421,8 @@ func (m *MessageRuleActions) SetPermanentDelete(value *bool)() { m.permanentDelete = value } } -// SetRedirectTo sets the redirectTo property value. The email address to which a message should be redirected. -func (m *MessageRuleActions) SetRedirectTo(value []Recipient)() { +// SetRedirectTo sets the redirectTo property value. The email addresses to which a message should be redirected. +func (m *MessageRuleActions) SetRedirectTo(value []Recipientable)() { if m != nil { m.redirectTo = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actionsable.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actionsable.go new file mode 100644 index 000000000..ccd162384 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_actionsable.go @@ -0,0 +1,32 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// MessageRuleActionsable +type MessageRuleActionsable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetAssignCategories()([]string) + GetCopyToFolder()(*string) + GetDelete()(*bool) + GetForwardAsAttachmentTo()([]Recipientable) + GetForwardTo()([]Recipientable) + GetMarkAsRead()(*bool) + GetMarkImportance()(*Importance) + GetMoveToFolder()(*string) + GetPermanentDelete()(*bool) + GetRedirectTo()([]Recipientable) + GetStopProcessingRules()(*bool) + SetAssignCategories(value []string)() + SetCopyToFolder(value *string)() + SetDelete(value *bool)() + SetForwardAsAttachmentTo(value []Recipientable)() + SetForwardTo(value []Recipientable)() + SetMarkAsRead(value *bool)() + SetMarkImportance(value *Importance)() + SetMoveToFolder(value *string)() + SetPermanentDelete(value *bool)() + SetRedirectTo(value []Recipientable)() + SetStopProcessingRules(value *bool)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicates.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicates.go index 2f3bc9ed0..a4bd19c3a 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicates.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicates.go @@ -15,7 +15,7 @@ type MessageRulePredicates struct { // Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply. categories []string; // Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. - fromAddresses []Recipient; + fromAddresses []Recipientable; // Indicates whether an incoming message must have attachments in order for the condition or exception to apply. hasAttachments *bool; // Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. @@ -59,7 +59,7 @@ type MessageRulePredicates struct { // Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. sentOnlyToMe *bool; // Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. - sentToAddresses []Recipient; + sentToAddresses []Recipientable; // Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. sentToMe *bool; // Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. @@ -67,7 +67,7 @@ type MessageRulePredicates struct { // Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. subjectContains []string; // - withinSizeRange *SizeRange; + withinSizeRange SizeRangeable; } // NewMessageRulePredicates instantiates a new messageRulePredicates and sets the default values. func NewMessageRulePredicates()(*MessageRulePredicates) { @@ -76,6 +76,10 @@ func NewMessageRulePredicates()(*MessageRulePredicates) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMessageRulePredicatesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessageRulePredicatesFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessageRulePredicates(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MessageRulePredicates) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -108,222 +112,6 @@ func (m *MessageRulePredicates) GetCategories()([]string) { return m.categories } } -// GetFromAddresses gets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetFromAddresses()([]Recipient) { - if m == nil { - return nil - } else { - return m.fromAddresses - } -} -// GetHasAttachments gets the hasAttachments property value. Indicates whether an incoming message must have attachments in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetHasAttachments()(*bool) { - if m == nil { - return nil - } else { - return m.hasAttachments - } -} -// GetHeaderContains gets the headerContains property value. Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetHeaderContains()([]string) { - if m == nil { - return nil - } else { - return m.headerContains - } -} -// GetImportance gets the importance property value. -func (m *MessageRulePredicates) GetImportance()(*Importance) { - if m == nil { - return nil - } else { - return m.importance - } -} -// GetIsApprovalRequest gets the isApprovalRequest property value. Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsApprovalRequest()(*bool) { - if m == nil { - return nil - } else { - return m.isApprovalRequest - } -} -// GetIsAutomaticForward gets the isAutomaticForward property value. Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsAutomaticForward()(*bool) { - if m == nil { - return nil - } else { - return m.isAutomaticForward - } -} -// GetIsAutomaticReply gets the isAutomaticReply property value. Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsAutomaticReply()(*bool) { - if m == nil { - return nil - } else { - return m.isAutomaticReply - } -} -// GetIsEncrypted gets the isEncrypted property value. Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsEncrypted()(*bool) { - if m == nil { - return nil - } else { - return m.isEncrypted - } -} -// GetIsMeetingRequest gets the isMeetingRequest property value. Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsMeetingRequest()(*bool) { - if m == nil { - return nil - } else { - return m.isMeetingRequest - } -} -// GetIsMeetingResponse gets the isMeetingResponse property value. Indicates whether an incoming message must be a meeting response in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsMeetingResponse()(*bool) { - if m == nil { - return nil - } else { - return m.isMeetingResponse - } -} -// GetIsNonDeliveryReport gets the isNonDeliveryReport property value. Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsNonDeliveryReport()(*bool) { - if m == nil { - return nil - } else { - return m.isNonDeliveryReport - } -} -// GetIsPermissionControlled gets the isPermissionControlled property value. Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsPermissionControlled()(*bool) { - if m == nil { - return nil - } else { - return m.isPermissionControlled - } -} -// GetIsReadReceipt gets the isReadReceipt property value. Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsReadReceipt()(*bool) { - if m == nil { - return nil - } else { - return m.isReadReceipt - } -} -// GetIsSigned gets the isSigned property value. Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsSigned()(*bool) { - if m == nil { - return nil - } else { - return m.isSigned - } -} -// GetIsVoicemail gets the isVoicemail property value. Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetIsVoicemail()(*bool) { - if m == nil { - return nil - } else { - return m.isVoicemail - } -} -// GetMessageActionFlag gets the messageActionFlag property value. -func (m *MessageRulePredicates) GetMessageActionFlag()(*MessageActionFlag) { - if m == nil { - return nil - } else { - return m.messageActionFlag - } -} -// GetNotSentToMe gets the notSentToMe property value. Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetNotSentToMe()(*bool) { - if m == nil { - return nil - } else { - return m.notSentToMe - } -} -// GetRecipientContains gets the recipientContains property value. Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetRecipientContains()([]string) { - if m == nil { - return nil - } else { - return m.recipientContains - } -} -// GetSenderContains gets the senderContains property value. Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSenderContains()([]string) { - if m == nil { - return nil - } else { - return m.senderContains - } -} -// GetSensitivity gets the sensitivity property value. -func (m *MessageRulePredicates) GetSensitivity()(*Sensitivity) { - if m == nil { - return nil - } else { - return m.sensitivity - } -} -// GetSentCcMe gets the sentCcMe property value. Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSentCcMe()(*bool) { - if m == nil { - return nil - } else { - return m.sentCcMe - } -} -// GetSentOnlyToMe gets the sentOnlyToMe property value. Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSentOnlyToMe()(*bool) { - if m == nil { - return nil - } else { - return m.sentOnlyToMe - } -} -// GetSentToAddresses gets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSentToAddresses()([]Recipient) { - if m == nil { - return nil - } else { - return m.sentToAddresses - } -} -// GetSentToMe gets the sentToMe property value. Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSentToMe()(*bool) { - if m == nil { - return nil - } else { - return m.sentToMe - } -} -// GetSentToOrCcMe gets the sentToOrCcMe property value. Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSentToOrCcMe()(*bool) { - if m == nil { - return nil - } else { - return m.sentToOrCcMe - } -} -// GetSubjectContains gets the subjectContains property value. Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) GetSubjectContains()([]string) { - if m == nil { - return nil - } else { - return m.subjectContains - } -} -// GetWithinSizeRange gets the withinSizeRange property value. -func (m *MessageRulePredicates) GetWithinSizeRange()(*SizeRange) { - if m == nil { - return nil - } else { - return m.withinSizeRange - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessageRulePredicates) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -370,14 +158,14 @@ func (m *MessageRulePredicates) GetFieldDeserializers()(map[string]func(interfac return nil } res["fromAddresses"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetFromAddresses(res) } @@ -606,14 +394,14 @@ func (m *MessageRulePredicates) GetFieldDeserializers()(map[string]func(interfac return nil } res["sentToAddresses"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewRecipient() }) + val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]Recipient, len(val)) + res := make([]Recipientable, len(val)) for i, v := range val { - res[i] = *(v.(*Recipient)) + res[i] = v.(Recipientable) } m.SetSentToAddresses(res) } @@ -654,17 +442,233 @@ func (m *MessageRulePredicates) GetFieldDeserializers()(map[string]func(interfac return nil } res["withinSizeRange"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSizeRange() }) + val, err := n.GetObjectValue(CreateSizeRangeFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetWithinSizeRange(val.(*SizeRange)) + m.SetWithinSizeRange(val.(SizeRangeable)) } return nil } return res } +// GetFromAddresses gets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetFromAddresses()([]Recipientable) { + if m == nil { + return nil + } else { + return m.fromAddresses + } +} +// GetHasAttachments gets the hasAttachments property value. Indicates whether an incoming message must have attachments in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetHasAttachments()(*bool) { + if m == nil { + return nil + } else { + return m.hasAttachments + } +} +// GetHeaderContains gets the headerContains property value. Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetHeaderContains()([]string) { + if m == nil { + return nil + } else { + return m.headerContains + } +} +// GetImportance gets the importance property value. +func (m *MessageRulePredicates) GetImportance()(*Importance) { + if m == nil { + return nil + } else { + return m.importance + } +} +// GetIsApprovalRequest gets the isApprovalRequest property value. Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsApprovalRequest()(*bool) { + if m == nil { + return nil + } else { + return m.isApprovalRequest + } +} +// GetIsAutomaticForward gets the isAutomaticForward property value. Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsAutomaticForward()(*bool) { + if m == nil { + return nil + } else { + return m.isAutomaticForward + } +} +// GetIsAutomaticReply gets the isAutomaticReply property value. Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsAutomaticReply()(*bool) { + if m == nil { + return nil + } else { + return m.isAutomaticReply + } +} +// GetIsEncrypted gets the isEncrypted property value. Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsEncrypted()(*bool) { + if m == nil { + return nil + } else { + return m.isEncrypted + } +} +// GetIsMeetingRequest gets the isMeetingRequest property value. Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsMeetingRequest()(*bool) { + if m == nil { + return nil + } else { + return m.isMeetingRequest + } +} +// GetIsMeetingResponse gets the isMeetingResponse property value. Indicates whether an incoming message must be a meeting response in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsMeetingResponse()(*bool) { + if m == nil { + return nil + } else { + return m.isMeetingResponse + } +} +// GetIsNonDeliveryReport gets the isNonDeliveryReport property value. Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsNonDeliveryReport()(*bool) { + if m == nil { + return nil + } else { + return m.isNonDeliveryReport + } +} +// GetIsPermissionControlled gets the isPermissionControlled property value. Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsPermissionControlled()(*bool) { + if m == nil { + return nil + } else { + return m.isPermissionControlled + } +} +// GetIsReadReceipt gets the isReadReceipt property value. Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsReadReceipt()(*bool) { + if m == nil { + return nil + } else { + return m.isReadReceipt + } +} +// GetIsSigned gets the isSigned property value. Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsSigned()(*bool) { + if m == nil { + return nil + } else { + return m.isSigned + } +} +// GetIsVoicemail gets the isVoicemail property value. Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetIsVoicemail()(*bool) { + if m == nil { + return nil + } else { + return m.isVoicemail + } +} +// GetMessageActionFlag gets the messageActionFlag property value. +func (m *MessageRulePredicates) GetMessageActionFlag()(*MessageActionFlag) { + if m == nil { + return nil + } else { + return m.messageActionFlag + } +} +// GetNotSentToMe gets the notSentToMe property value. Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetNotSentToMe()(*bool) { + if m == nil { + return nil + } else { + return m.notSentToMe + } +} +// GetRecipientContains gets the recipientContains property value. Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetRecipientContains()([]string) { + if m == nil { + return nil + } else { + return m.recipientContains + } +} +// GetSenderContains gets the senderContains property value. Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSenderContains()([]string) { + if m == nil { + return nil + } else { + return m.senderContains + } +} +// GetSensitivity gets the sensitivity property value. +func (m *MessageRulePredicates) GetSensitivity()(*Sensitivity) { + if m == nil { + return nil + } else { + return m.sensitivity + } +} +// GetSentCcMe gets the sentCcMe property value. Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSentCcMe()(*bool) { + if m == nil { + return nil + } else { + return m.sentCcMe + } +} +// GetSentOnlyToMe gets the sentOnlyToMe property value. Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSentOnlyToMe()(*bool) { + if m == nil { + return nil + } else { + return m.sentOnlyToMe + } +} +// GetSentToAddresses gets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSentToAddresses()([]Recipientable) { + if m == nil { + return nil + } else { + return m.sentToAddresses + } +} +// GetSentToMe gets the sentToMe property value. Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSentToMe()(*bool) { + if m == nil { + return nil + } else { + return m.sentToMe + } +} +// GetSentToOrCcMe gets the sentToOrCcMe property value. Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSentToOrCcMe()(*bool) { + if m == nil { + return nil + } else { + return m.sentToOrCcMe + } +} +// GetSubjectContains gets the subjectContains property value. Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. +func (m *MessageRulePredicates) GetSubjectContains()([]string) { + if m == nil { + return nil + } else { + return m.subjectContains + } +} +// GetWithinSizeRange gets the withinSizeRange property value. +func (m *MessageRulePredicates) GetWithinSizeRange()(SizeRangeable) { + if m == nil { + return nil + } else { + return m.withinSizeRange + } +} func (m *MessageRulePredicates) IsNil()(bool) { return m == nil } @@ -691,8 +695,7 @@ func (m *MessageRulePredicates) Serialize(writer i04eb5309aeaafadd28374d79c8471d if m.GetFromAddresses() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetFromAddresses())) for i, v := range m.GetFromAddresses() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("fromAddresses", cast) if err != nil { @@ -831,8 +834,7 @@ func (m *MessageRulePredicates) Serialize(writer i04eb5309aeaafadd28374d79c8471d if m.GetSentToAddresses() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetSentToAddresses())) for i, v := range m.GetSentToAddresses() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("sentToAddresses", cast) if err != nil { @@ -896,7 +898,7 @@ func (m *MessageRulePredicates) SetCategories(value []string)() { } } // SetFromAddresses sets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. -func (m *MessageRulePredicates) SetFromAddresses(value []Recipient)() { +func (m *MessageRulePredicates) SetFromAddresses(value []Recipientable)() { if m != nil { m.fromAddresses = value } @@ -1028,7 +1030,7 @@ func (m *MessageRulePredicates) SetSentOnlyToMe(value *bool)() { } } // SetSentToAddresses sets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. -func (m *MessageRulePredicates) SetSentToAddresses(value []Recipient)() { +func (m *MessageRulePredicates) SetSentToAddresses(value []Recipientable)() { if m != nil { m.sentToAddresses = value } @@ -1052,7 +1054,7 @@ func (m *MessageRulePredicates) SetSubjectContains(value []string)() { } } // SetWithinSizeRange sets the withinSizeRange property value. -func (m *MessageRulePredicates) SetWithinSizeRange(value *SizeRange)() { +func (m *MessageRulePredicates) SetWithinSizeRange(value SizeRangeable)() { if m != nil { m.withinSizeRange = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicatesable.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicatesable.go new file mode 100644 index 000000000..5ea37177d --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_rule_predicatesable.go @@ -0,0 +1,70 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// MessageRulePredicatesable +type MessageRulePredicatesable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetBodyContains()([]string) + GetBodyOrSubjectContains()([]string) + GetCategories()([]string) + GetFromAddresses()([]Recipientable) + GetHasAttachments()(*bool) + GetHeaderContains()([]string) + GetImportance()(*Importance) + GetIsApprovalRequest()(*bool) + GetIsAutomaticForward()(*bool) + GetIsAutomaticReply()(*bool) + GetIsEncrypted()(*bool) + GetIsMeetingRequest()(*bool) + GetIsMeetingResponse()(*bool) + GetIsNonDeliveryReport()(*bool) + GetIsPermissionControlled()(*bool) + GetIsReadReceipt()(*bool) + GetIsSigned()(*bool) + GetIsVoicemail()(*bool) + GetMessageActionFlag()(*MessageActionFlag) + GetNotSentToMe()(*bool) + GetRecipientContains()([]string) + GetSenderContains()([]string) + GetSensitivity()(*Sensitivity) + GetSentCcMe()(*bool) + GetSentOnlyToMe()(*bool) + GetSentToAddresses()([]Recipientable) + GetSentToMe()(*bool) + GetSentToOrCcMe()(*bool) + GetSubjectContains()([]string) + GetWithinSizeRange()(SizeRangeable) + SetBodyContains(value []string)() + SetBodyOrSubjectContains(value []string)() + SetCategories(value []string)() + SetFromAddresses(value []Recipientable)() + SetHasAttachments(value *bool)() + SetHeaderContains(value []string)() + SetImportance(value *Importance)() + SetIsApprovalRequest(value *bool)() + SetIsAutomaticForward(value *bool)() + SetIsAutomaticReply(value *bool)() + SetIsEncrypted(value *bool)() + SetIsMeetingRequest(value *bool)() + SetIsMeetingResponse(value *bool)() + SetIsNonDeliveryReport(value *bool)() + SetIsPermissionControlled(value *bool)() + SetIsReadReceipt(value *bool)() + SetIsSigned(value *bool)() + SetIsVoicemail(value *bool)() + SetMessageActionFlag(value *MessageActionFlag)() + SetNotSentToMe(value *bool)() + SetRecipientContains(value []string)() + SetSenderContains(value []string)() + SetSensitivity(value *Sensitivity)() + SetSentCcMe(value *bool)() + SetSentOnlyToMe(value *bool)() + SetSentToAddresses(value []Recipientable)() + SetSentToMe(value *bool)() + SetSentToOrCcMe(value *bool)() + SetSubjectContains(value []string)() + SetWithinSizeRange(value SizeRangeable)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/message_ruleable.go b/msgraph-mail/go/utilities/models/microsoft/graph/message_ruleable.go new file mode 100644 index 000000000..cd2f2e01f --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/message_ruleable.go @@ -0,0 +1,21 @@ +package graph +// MessageRuleable +type MessageRuleable interface { + Entityable + GetActions()(MessageRuleActionsable) + GetConditions()(MessageRulePredicatesable) + GetDisplayName()(*string) + GetExceptions()(MessageRulePredicatesable) + GetHasError()(*bool) + GetIsEnabled()(*bool) + GetIsReadOnly()(*bool) + GetSequence()(*int32) + SetActions(value MessageRuleActionsable)() + SetConditions(value MessageRulePredicatesable)() + SetDisplayName(value *string)() + SetExceptions(value MessageRulePredicatesable)() + SetHasError(value *bool)() + SetIsEnabled(value *bool)() + SetIsReadOnly(value *bool)() + SetSequence(value *int32)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/messageable.go b/msgraph-mail/go/utilities/models/microsoft/graph/messageable.go new file mode 100644 index 000000000..c5c09e04f --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/messageable.go @@ -0,0 +1,70 @@ +package graph + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// Messageable +type Messageable interface { + OutlookItemable + GetAttachments()([]Attachmentable) + GetBccRecipients()([]Recipientable) + GetBody()(ItemBodyable) + GetBodyPreview()(*string) + GetCcRecipients()([]Recipientable) + GetConversationId()(*string) + GetConversationIndex()([]byte) + GetExtensions()([]Extensionable) + GetFlag()(FollowupFlagable) + GetFrom()(Recipientable) + GetHasAttachments()(*bool) + GetImportance()(*Importance) + GetInferenceClassification()(*InferenceClassificationType) + GetInternetMessageHeaders()([]InternetMessageHeaderable) + GetInternetMessageId()(*string) + GetIsDeliveryReceiptRequested()(*bool) + GetIsDraft()(*bool) + GetIsRead()(*bool) + GetIsReadReceiptRequested()(*bool) + GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) + GetParentFolderId()(*string) + GetReceivedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReplyTo()([]Recipientable) + GetSender()(Recipientable) + GetSentDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) + GetSubject()(*string) + GetToRecipients()([]Recipientable) + GetUniqueBody()(ItemBodyable) + GetWebLink()(*string) + SetAttachments(value []Attachmentable)() + SetBccRecipients(value []Recipientable)() + SetBody(value ItemBodyable)() + SetBodyPreview(value *string)() + SetCcRecipients(value []Recipientable)() + SetConversationId(value *string)() + SetConversationIndex(value []byte)() + SetExtensions(value []Extensionable)() + SetFlag(value FollowupFlagable)() + SetFrom(value Recipientable)() + SetHasAttachments(value *bool)() + SetImportance(value *Importance)() + SetInferenceClassification(value *InferenceClassificationType)() + SetInternetMessageHeaders(value []InternetMessageHeaderable)() + SetInternetMessageId(value *string)() + SetIsDeliveryReceiptRequested(value *bool)() + SetIsDraft(value *bool)() + SetIsRead(value *bool)() + SetIsReadReceiptRequested(value *bool)() + SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() + SetParentFolderId(value *string)() + SetReceivedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReplyTo(value []Recipientable)() + SetSender(value Recipientable)() + SetSentDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() + SetSubject(value *string)() + SetToRecipients(value []Recipientable)() + SetUniqueBody(value ItemBodyable)() + SetWebLink(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_property.go b/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_property.go index 7f377ef27..45d0781d8 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_property.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_property.go @@ -17,13 +17,9 @@ func NewMultiValueLegacyExtendedProperty()(*MultiValueLegacyExtendedProperty) { } return m } -// GetValue gets the value property value. A collection of property values. -func (m *MultiValueLegacyExtendedProperty) GetValue()([]string) { - if m == nil { - return nil - } else { - return m.value - } +// CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMultiValueLegacyExtendedProperty(), nil } // GetFieldDeserializers the deserialization information for the current model func (m *MultiValueLegacyExtendedProperty) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { @@ -44,6 +40,14 @@ func (m *MultiValueLegacyExtendedProperty) GetFieldDeserializers()(map[string]fu } return res } +// GetValue gets the value property value. A collection of property values. +func (m *MultiValueLegacyExtendedProperty) GetValue()([]string) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MultiValueLegacyExtendedProperty) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_propertyable.go b/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_propertyable.go new file mode 100644 index 000000000..416889730 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/multi_value_legacy_extended_propertyable.go @@ -0,0 +1,7 @@ +package graph +// MultiValueLegacyExtendedPropertyable +type MultiValueLegacyExtendedPropertyable interface { + Entityable + GetValue()([]string) + SetValue(value []string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/outlook_item.go b/msgraph-mail/go/utilities/models/microsoft/graph/outlook_item.go index bf2a537fa..3d0dc0686 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/outlook_item.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/outlook_item.go @@ -24,6 +24,10 @@ func NewOutlookItem()(*OutlookItem) { } return m } +// CreateOutlookItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateOutlookItemFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewOutlookItem(), nil +} // GetCategories gets the categories property value. The categories associated with the item func (m *OutlookItem) GetCategories()([]string) { if m == nil { @@ -48,14 +52,6 @@ func (m *OutlookItem) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f return m.createdDateTime } } -// GetLastModifiedDateTime gets the lastModifiedDateTime property value. 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 -func (m *OutlookItem) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { - if m == nil { - return nil - } else { - return m.lastModifiedDateTime - } -} // GetFieldDeserializers the deserialization information for the current model func (m *OutlookItem) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() @@ -105,6 +101,14 @@ func (m *OutlookItem) GetFieldDeserializers()(map[string]func(interface{}, i04eb } return res } +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. 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 +func (m *OutlookItem) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + if m == nil { + return nil + } else { + return m.lastModifiedDateTime + } +} func (m *OutlookItem) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/outlook_itemable.go b/msgraph-mail/go/utilities/models/microsoft/graph/outlook_itemable.go new file mode 100644 index 000000000..ba206ace4 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/outlook_itemable.go @@ -0,0 +1,18 @@ +package graph + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// OutlookItemable +type OutlookItemable interface { + Entityable + GetCategories()([]string) + GetChangeKey()(*string) + GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCategories(value []string)() + SetChangeKey(value *string)() + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/recipient.go b/msgraph-mail/go/utilities/models/microsoft/graph/recipient.go index 58a576b31..2d3cc5129 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/recipient.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/recipient.go @@ -9,7 +9,7 @@ type Recipient struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]interface{}; // - emailAddress *EmailAddress; + emailAddress EmailAddressable; } // NewRecipient instantiates a new recipient and sets the default values. func NewRecipient()(*Recipient) { @@ -18,6 +18,10 @@ func NewRecipient()(*Recipient) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateRecipientFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRecipientFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewRecipient(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *Recipient) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -27,7 +31,7 @@ func (m *Recipient) GetAdditionalData()(map[string]interface{}) { } } // GetEmailAddress gets the emailAddress property value. -func (m *Recipient) GetEmailAddress()(*EmailAddress) { +func (m *Recipient) GetEmailAddress()(EmailAddressable) { if m == nil { return nil } else { @@ -38,12 +42,12 @@ func (m *Recipient) GetEmailAddress()(*EmailAddress) { func (m *Recipient) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) res["emailAddress"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetObjectValue(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewEmailAddress() }) + val, err := n.GetObjectValue(CreateEmailAddressFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetEmailAddress(val.(*EmailAddress)) + m.SetEmailAddress(val.(EmailAddressable)) } return nil } @@ -75,7 +79,7 @@ func (m *Recipient) SetAdditionalData(value map[string]interface{})() { } } // SetEmailAddress sets the emailAddress property value. -func (m *Recipient) SetEmailAddress(value *EmailAddress)() { +func (m *Recipient) SetEmailAddress(value EmailAddressable)() { if m != nil { m.emailAddress = value } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/recipientable.go b/msgraph-mail/go/utilities/models/microsoft/graph/recipientable.go new file mode 100644 index 000000000..db15a6d32 --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/recipientable.go @@ -0,0 +1,12 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// Recipientable +type Recipientable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetEmailAddress()(EmailAddressable) + SetEmailAddress(value EmailAddressable)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_property.go b/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_property.go index c53a76ce3..47d63f914 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_property.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_property.go @@ -17,13 +17,9 @@ func NewSingleValueLegacyExtendedProperty()(*SingleValueLegacyExtendedProperty) } return m } -// GetValue gets the value property value. A property value. -func (m *SingleValueLegacyExtendedProperty) GetValue()(*string) { - if m == nil { - return nil - } else { - return m.value - } +// CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewSingleValueLegacyExtendedProperty(), nil } // GetFieldDeserializers the deserialization information for the current model func (m *SingleValueLegacyExtendedProperty) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { @@ -40,6 +36,14 @@ func (m *SingleValueLegacyExtendedProperty) GetFieldDeserializers()(map[string]f } return res } +// GetValue gets the value property value. A property value. +func (m *SingleValueLegacyExtendedProperty) GetValue()(*string) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *SingleValueLegacyExtendedProperty) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_propertyable.go b/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_propertyable.go new file mode 100644 index 000000000..8db0b429d --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/single_value_legacy_extended_propertyable.go @@ -0,0 +1,7 @@ +package graph +// SingleValueLegacyExtendedPropertyable +type SingleValueLegacyExtendedPropertyable interface { + Entityable + GetValue()(*string) + SetValue(value *string)() +} diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/size_range.go b/msgraph-mail/go/utilities/models/microsoft/graph/size_range.go index d99f93608..6e44be1bf 100644 --- a/msgraph-mail/go/utilities/models/microsoft/graph/size_range.go +++ b/msgraph-mail/go/utilities/models/microsoft/graph/size_range.go @@ -20,6 +20,10 @@ func NewSizeRange()(*SizeRange) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateSizeRangeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSizeRangeFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewSizeRange(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *SizeRange) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -28,22 +32,6 @@ func (m *SizeRange) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetMaximumSize gets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. -func (m *SizeRange) GetMaximumSize()(*int32) { - if m == nil { - return nil - } else { - return m.maximumSize - } -} -// GetMinimumSize gets the minimumSize property value. The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. -func (m *SizeRange) GetMinimumSize()(*int32) { - if m == nil { - return nil - } else { - return m.minimumSize - } -} // GetFieldDeserializers the deserialization information for the current model func (m *SizeRange) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -69,6 +57,22 @@ func (m *SizeRange) GetFieldDeserializers()(map[string]func(interface{}, i04eb53 } return res } +// GetMaximumSize gets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. +func (m *SizeRange) GetMaximumSize()(*int32) { + if m == nil { + return nil + } else { + return m.maximumSize + } +} +// GetMinimumSize gets the minimumSize property value. The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. +func (m *SizeRange) GetMinimumSize()(*int32) { + if m == nil { + return nil + } else { + return m.minimumSize + } +} func (m *SizeRange) IsNil()(bool) { return m == nil } diff --git a/msgraph-mail/go/utilities/models/microsoft/graph/size_rangeable.go b/msgraph-mail/go/utilities/models/microsoft/graph/size_rangeable.go new file mode 100644 index 000000000..b18a6a92e --- /dev/null +++ b/msgraph-mail/go/utilities/models/microsoft/graph/size_rangeable.go @@ -0,0 +1,14 @@ +package graph + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" +) + +// SizeRangeable +type SizeRangeable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetMaximumSize()(*int32) + GetMinimumSize()(*int32) + SetMaximumSize(value *int32)() + SetMinimumSize(value *int32)() +} diff --git a/msgraph-mail/go/utilities/users/item/inferenceclassification/inference_classification_request_builder.go b/msgraph-mail/go/utilities/users/item/inferenceclassification/inference_classification_request_builder.go index fae6b7ea8..b0de45298 100644 --- a/msgraph-mail/go/utilities/users/item/inferenceclassification/inference_classification_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/inferenceclassification/inference_classification_request_builder.go @@ -2,7 +2,6 @@ package inferenceclassification import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" i3b892eb54cedbd9cc555b9f1a7958d6152b7730fa895edaed6eaa7e22b3c15ca "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides" ie9af6222ea455c01969cfed303f450bfed10eddca9c64da588590323f4684264 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item" @@ -45,7 +44,7 @@ type InferenceClassificationRequestBuilderGetQueryParameters struct { // InferenceClassificationRequestBuilderPatchOptions options for Patch type InferenceClassificationRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassification; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationable; // Request headers H map[string]string; // Request options @@ -62,7 +61,7 @@ func NewInferenceClassificationRequestBuilderInternal(pathParameters map[string] for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -133,29 +132,29 @@ func (m *InferenceClassificationRequestBuilder) Delete(options *InferenceClassif if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. -func (m *InferenceClassificationRequestBuilder) Get(options *InferenceClassificationRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassification, error) { +func (m *InferenceClassificationRequestBuilder) Get(options *InferenceClassificationRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewInferenceClassification() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateInferenceClassificationFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassification), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationable), nil } func (m *InferenceClassificationRequestBuilder) Overrides()(*i3b892eb54cedbd9cc555b9f1a7958d6152b7730fa895edaed6eaa7e22b3c15ca.OverridesRequestBuilder) { return i3b892eb54cedbd9cc555b9f1a7958d6152b7730fa895edaed6eaa7e22b3c15ca.NewOverridesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // OverridesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.inferenceClassification.overrides.item collection -func (m *InferenceClassificationRequestBuilder) OverridesById(id string)(*ie9af6222ea455c01969cfed303f450bfed10eddca9c64da588590323f4684264.InferenceClassificationOverrideRequestBuilder) { +func (m *InferenceClassificationRequestBuilder) OverridesById(id string)(*ie9af6222ea455c01969cfed303f450bfed10eddca9c64da588590323f4684264.InferenceClassificationOverrideItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -163,7 +162,7 @@ func (m *InferenceClassificationRequestBuilder) OverridesById(id string)(*ie9af6 if id != "" { urlTplParams["inferenceClassificationOverride_id"] = id } - return ie9af6222ea455c01969cfed303f450bfed10eddca9c64da588590323f4684264.NewInferenceClassificationOverrideRequestBuilderInternal(urlTplParams, m.requestAdapter); + return ie9af6222ea455c01969cfed303f450bfed10eddca9c64da588590323f4684264.NewInferenceClassificationOverrideItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Patch relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. func (m *InferenceClassificationRequestBuilder) Patch(options *InferenceClassificationRequestBuilderPatchOptions)(error) { @@ -171,7 +170,7 @@ func (m *InferenceClassificationRequestBuilder) Patch(options *InferenceClassifi if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_request_builder.go b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_item_request_builder.go similarity index 58% rename from msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_request_builder.go rename to msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_item_request_builder.go index 6b61ee7bc..9fcfebad0 100644 --- a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/item/inference_classification_override_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// InferenceClassificationOverrideRequestBuilder builds and executes requests for operations under \users\{user-id}\inferenceClassification\overrides\{inferenceClassificationOverride-id} -type InferenceClassificationOverrideRequestBuilder struct { +// InferenceClassificationOverrideItemRequestBuilder builds and executes requests for operations under \users\{user-id}\inferenceClassification\overrides\{inferenceClassificationOverride-id} +type InferenceClassificationOverrideItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type InferenceClassificationOverrideRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// InferenceClassificationOverrideRequestBuilderDeleteOptions options for Delete -type InferenceClassificationOverrideRequestBuilderDeleteOptions struct { +// InferenceClassificationOverrideItemRequestBuilderDeleteOptions options for Delete +type InferenceClassificationOverrideItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,26 +23,26 @@ type InferenceClassificationOverrideRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// InferenceClassificationOverrideRequestBuilderGetOptions options for Get -type InferenceClassificationOverrideRequestBuilderGetOptions struct { +// InferenceClassificationOverrideItemRequestBuilderGetOptions options for Get +type InferenceClassificationOverrideItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *InferenceClassificationOverrideRequestBuilderGetQueryParameters; + Q *InferenceClassificationOverrideItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// InferenceClassificationOverrideRequestBuilderGetQueryParameters a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -type InferenceClassificationOverrideRequestBuilderGetQueryParameters struct { +// InferenceClassificationOverrideItemRequestBuilderGetQueryParameters a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. +type InferenceClassificationOverrideItemRequestBuilderGetQueryParameters struct { // Select properties to be returned Select []string; } -// InferenceClassificationOverrideRequestBuilderPatchOptions options for Patch -type InferenceClassificationOverrideRequestBuilderPatchOptions struct { +// InferenceClassificationOverrideItemRequestBuilderPatchOptions options for Patch +type InferenceClassificationOverrideItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable; // Request headers H map[string]string; // Request options @@ -51,27 +50,27 @@ type InferenceClassificationOverrideRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewInferenceClassificationOverrideRequestBuilderInternal instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. -func NewInferenceClassificationOverrideRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*InferenceClassificationOverrideRequestBuilder) { - m := &InferenceClassificationOverrideRequestBuilder{ +// NewInferenceClassificationOverrideItemRequestBuilderInternal instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. +func NewInferenceClassificationOverrideItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*InferenceClassificationOverrideItemRequestBuilder) { + m := &InferenceClassificationOverrideItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewInferenceClassificationOverrideRequestBuilder instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. -func NewInferenceClassificationOverrideRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*InferenceClassificationOverrideRequestBuilder) { +// NewInferenceClassificationOverrideItemRequestBuilder instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. +func NewInferenceClassificationOverrideItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*InferenceClassificationOverrideItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewInferenceClassificationOverrideRequestBuilderInternal(urlParams, requestAdapter) + return NewInferenceClassificationOverrideItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) CreateDeleteRequestInformation(options *InferenceClassificationOverrideRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) CreateDeleteRequestInformation(options *InferenceClassificationOverrideItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -88,7 +87,7 @@ func (m *InferenceClassificationOverrideRequestBuilder) CreateDeleteRequestInfor return requestInfo, nil } // CreateGetRequestInformation a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) CreateGetRequestInformation(options *InferenceClassificationOverrideRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) CreateGetRequestInformation(options *InferenceClassificationOverrideItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -108,7 +107,7 @@ func (m *InferenceClassificationOverrideRequestBuilder) CreateGetRequestInformat return requestInfo, nil } // CreatePatchRequestInformation a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) CreatePatchRequestInformation(options *InferenceClassificationOverrideRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) CreatePatchRequestInformation(options *InferenceClassificationOverrideItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -126,36 +125,36 @@ func (m *InferenceClassificationOverrideRequestBuilder) CreatePatchRequestInform return requestInfo, nil } // Delete a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) Delete(options *InferenceClassificationOverrideRequestBuilderDeleteOptions)(error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) Delete(options *InferenceClassificationOverrideItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) Get(options *InferenceClassificationOverrideRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride, error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) Get(options *InferenceClassificationOverrideItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewInferenceClassificationOverride() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateInferenceClassificationOverrideFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable), nil } // Patch a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *InferenceClassificationOverrideRequestBuilder) Patch(options *InferenceClassificationOverrideRequestBuilderPatchOptions)(error) { +func (m *InferenceClassificationOverrideItemRequestBuilder) Patch(options *InferenceClassificationOverrideItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_request_builder.go b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_request_builder.go index 34a6b1933..dd81f918c 100644 --- a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_request_builder.go @@ -2,7 +2,6 @@ package overrides import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -44,7 +43,7 @@ type OverridesRequestBuilderGetQueryParameters struct { // OverridesRequestBuilderPostOptions options for Post type OverridesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable; // Request headers H map[string]string; // Request options @@ -61,7 +60,7 @@ func NewOverridesRequestBuilderInternal(pathParameters map[string]string, reques for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -110,26 +109,26 @@ func (m *OverridesRequestBuilder) CreatePostRequestInformation(options *Override return requestInfo, nil } // Get a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *OverridesRequestBuilder) Get(options *OverridesRequestBuilderGetOptions)(*OverridesResponse, error) { +func (m *OverridesRequestBuilder) Get(options *OverridesRequestBuilderGetOptions)(OverridesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewOverridesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateOverridesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*OverridesResponse), nil + return res.(OverridesResponseable), nil } // Post a set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. -func (m *OverridesRequestBuilder) Post(options *OverridesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride, error) { +func (m *OverridesRequestBuilder) Post(options *OverridesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewInferenceClassificationOverride() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateInferenceClassificationOverrideFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable), nil } diff --git a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_response.go b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_response.go index 99bea48ae..f63f76a9b 100644 --- a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_response.go +++ b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_response.go @@ -12,7 +12,7 @@ type OverridesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable; } // NewOverridesResponse instantiates a new overridesResponse and sets the default values. func NewOverridesResponse()(*OverridesResponse) { @@ -21,6 +21,10 @@ func NewOverridesResponse()(*OverridesResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateOverridesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateOverridesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewOverridesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *OverridesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *OverridesResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *OverridesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *OverridesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *OverridesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *OverridesResponse) GetFieldDeserializers()(map[string]func(interface{}, return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewInferenceClassificationOverride() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateInferenceClassificationOverrideFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *OverridesResponse) GetFieldDeserializers()(map[string]func(interface{}, } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *OverridesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *OverridesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *OverridesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *OverridesResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b2 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *OverridesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *OverridesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverride)() { +func (m *OverridesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_responseable.go b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_responseable.go new file mode 100644 index 000000000..7be831ba7 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/inferenceclassification/overrides/overrides_responseable.go @@ -0,0 +1,15 @@ +package overrides + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// OverridesResponseable +type OverridesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.InferenceClassificationOverrideable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_request_builder.go index ab6d8fd61..8ec40b068 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_request_builder.go @@ -2,7 +2,6 @@ package childfolders import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type ChildFoldersRequestBuilderGetQueryParameters struct { // ChildFoldersRequestBuilderPostOptions options for Post type ChildFoldersRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewChildFoldersRequestBuilderInternal(pathParameters map[string]string, req for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *ChildFoldersRequestBuilder) CreatePostRequestInformation(options *Child return requestInfo, nil } // Get the collection of child folders in the mailFolder. -func (m *ChildFoldersRequestBuilder) Get(options *ChildFoldersRequestBuilderGetOptions)(*ChildFoldersResponse, error) { +func (m *ChildFoldersRequestBuilder) Get(options *ChildFoldersRequestBuilderGetOptions)(ChildFoldersResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewChildFoldersResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateChildFoldersResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*ChildFoldersResponse), nil + return res.(ChildFoldersResponseable), nil } // Post the collection of child folders in the mailFolder. -func (m *ChildFoldersRequestBuilder) Post(options *ChildFoldersRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, error) { +func (m *ChildFoldersRequestBuilder) Post(options *ChildFoldersRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_response.go index ed5bbbb68..9f7e15032 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_response.go @@ -12,7 +12,7 @@ type ChildFoldersResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; } // NewChildFoldersResponse instantiates a new childFoldersResponse and sets the default values. func NewChildFoldersResponse()(*ChildFoldersResponse) { @@ -21,6 +21,10 @@ func NewChildFoldersResponse()(*ChildFoldersResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateChildFoldersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateChildFoldersResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewChildFoldersResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *ChildFoldersResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *ChildFoldersResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *ChildFoldersResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *ChildFoldersResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *ChildFoldersResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *ChildFoldersResponse) GetFieldDeserializers()(map[string]func(interface return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *ChildFoldersResponse) GetFieldDeserializers()(map[string]func(interface } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *ChildFoldersResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *ChildFoldersResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *ChildFoldersResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *ChildFoldersResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *ChildFoldersResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *ChildFoldersResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder)() { +func (m *ChildFoldersResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_responseable.go new file mode 100644 index 000000000..2378c9f7e --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/child_folders_responseable.go @@ -0,0 +1,15 @@ +package childfolders + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// ChildFoldersResponseable +type ChildFoldersResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_item_request_builder.go index a81372dc7..91a2b428e 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders/item/mail_folder_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// MailFolderRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\childFolders\{mailFolder-id1} -type MailFolderRequestBuilder struct { +// MailFolderItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\childFolders\{mailFolder-id1} +type MailFolderItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type MailFolderRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MailFolderRequestBuilderDeleteOptions options for Delete -type MailFolderRequestBuilderDeleteOptions struct { +// MailFolderItemRequestBuilderDeleteOptions options for Delete +type MailFolderItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type MailFolderRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MailFolderRequestBuilderGetOptions options for Get -type MailFolderRequestBuilderGetOptions struct { +// MailFolderItemRequestBuilderGetOptions options for Get +type MailFolderItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MailFolderRequestBuilderGetQueryParameters; + Q *MailFolderItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MailFolderRequestBuilderGetQueryParameters the collection of child folders in the mailFolder. -type MailFolderRequestBuilderGetQueryParameters struct { +// MailFolderItemRequestBuilderGetQueryParameters the collection of child folders in the mailFolder. +type MailFolderItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// MailFolderRequestBuilderPatchOptions options for Patch -type MailFolderRequestBuilderPatchOptions struct { +// MailFolderItemRequestBuilderPatchOptions options for Patch +type MailFolderItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type MailFolderRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewMailFolderRequestBuilderInternal instantiates a new MailFolderRequestBuilder and sets the default values. -func NewMailFolderRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderRequestBuilder) { - m := &MailFolderRequestBuilder{ +// NewMailFolderItemRequestBuilderInternal instantiates a new MailFolderItemRequestBuilder and sets the default values. +func NewMailFolderItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderItemRequestBuilder) { + m := &MailFolderItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders/{mailFolder_id1}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMailFolderRequestBuilder instantiates a new MailFolderRequestBuilder and sets the default values. -func NewMailFolderRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderRequestBuilder) { +// NewMailFolderItemRequestBuilder instantiates a new MailFolderItemRequestBuilder and sets the default values. +func NewMailFolderItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMailFolderRequestBuilderInternal(urlParams, requestAdapter) + return NewMailFolderItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) CreateDeleteRequestInformation(options *MailFolderRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreateDeleteRequestInformation(options *MailFolderItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *MailFolderRequestBuilder) CreateDeleteRequestInformation(options *MailF return requestInfo, nil } // CreateGetRequestInformation the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) CreateGetRequestInformation(options *MailFolderRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreateGetRequestInformation(options *MailFolderItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *MailFolderRequestBuilder) CreateGetRequestInformation(options *MailFold return requestInfo, nil } // CreatePatchRequestInformation the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) CreatePatchRequestInformation(options *MailFolderRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreatePatchRequestInformation(options *MailFolderItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *MailFolderRequestBuilder) CreatePatchRequestInformation(options *MailFo return requestInfo, nil } // Delete the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) Delete(options *MailFolderRequestBuilderDeleteOptions)(error) { +func (m *MailFolderItemRequestBuilder) Delete(options *MailFolderItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) Get(options *MailFolderRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, error) { +func (m *MailFolderItemRequestBuilder) Get(options *MailFolderItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable), nil } // Patch the collection of child folders in the mailFolder. -func (m *MailFolderRequestBuilder) Patch(options *MailFolderRequestBuilderPatchOptions)(error) { +func (m *MailFolderItemRequestBuilder) Patch(options *MailFolderItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_item_request_builder.go similarity index 65% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_item_request_builder.go index c4f5f90a5..ab1debc01 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/mail_folder_item_request_builder.go @@ -2,7 +2,6 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" i25eccaab35ae736780065dc9a8dc7482fdcb0caedd552ebe3bc32819574bdd1c "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/childfolders" i813340affbf9a598103dd11e02bd85608be12b91284a30d07f60a1aac1a263e6 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties" @@ -16,8 +15,8 @@ import ( idbb7dc5e3b94a6671fc2fde24821fbe6f90b0bfdd4d8781f45540e2e3d778e66 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item" ) -// MailFolderRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id} -type MailFolderRequestBuilder struct { +// MailFolderItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id} +type MailFolderItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -25,8 +24,8 @@ type MailFolderRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MailFolderRequestBuilderDeleteOptions options for Delete -type MailFolderRequestBuilderDeleteOptions struct { +// MailFolderItemRequestBuilderDeleteOptions options for Delete +type MailFolderItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -34,26 +33,26 @@ type MailFolderRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MailFolderRequestBuilderGetOptions options for Get -type MailFolderRequestBuilderGetOptions struct { +// MailFolderItemRequestBuilderGetOptions options for Get +type MailFolderItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MailFolderRequestBuilderGetQueryParameters; + Q *MailFolderItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MailFolderRequestBuilderGetQueryParameters the user's mail folders. Read-only. Nullable. -type MailFolderRequestBuilderGetQueryParameters struct { +// MailFolderItemRequestBuilderGetQueryParameters the user's mail folders. Read-only. Nullable. +type MailFolderItemRequestBuilderGetQueryParameters struct { // Select properties to be returned Select []string; } -// MailFolderRequestBuilderPatchOptions options for Patch -type MailFolderRequestBuilderPatchOptions struct { +// MailFolderItemRequestBuilderPatchOptions options for Patch +type MailFolderItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; // Request headers H map[string]string; // Request options @@ -61,11 +60,11 @@ type MailFolderRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -func (m *MailFolderRequestBuilder) ChildFolders()(*i25eccaab35ae736780065dc9a8dc7482fdcb0caedd552ebe3bc32819574bdd1c.ChildFoldersRequestBuilder) { +func (m *MailFolderItemRequestBuilder) ChildFolders()(*i25eccaab35ae736780065dc9a8dc7482fdcb0caedd552ebe3bc32819574bdd1c.ChildFoldersRequestBuilder) { return i25eccaab35ae736780065dc9a8dc7482fdcb0caedd552ebe3bc32819574bdd1c.NewChildFoldersRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // ChildFoldersById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.childFolders.item collection -func (m *MailFolderRequestBuilder) ChildFoldersById(id string)(*i181e312a167613000dccbb9ebecd1868a9fa4f41ee5a7ecb670740df9765d172.MailFolderRequestBuilder) { +func (m *MailFolderItemRequestBuilder) ChildFoldersById(id string)(*i181e312a167613000dccbb9ebecd1868a9fa4f41ee5a7ecb670740df9765d172.MailFolderItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -73,29 +72,29 @@ func (m *MailFolderRequestBuilder) ChildFoldersById(id string)(*i181e312a1676130 if id != "" { urlTplParams["mailFolder_id1"] = id } - return i181e312a167613000dccbb9ebecd1868a9fa4f41ee5a7ecb670740df9765d172.NewMailFolderRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i181e312a167613000dccbb9ebecd1868a9fa4f41ee5a7ecb670740df9765d172.NewMailFolderItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -// NewMailFolderRequestBuilderInternal instantiates a new MailFolderRequestBuilder and sets the default values. -func NewMailFolderRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderRequestBuilder) { - m := &MailFolderRequestBuilder{ +// NewMailFolderItemRequestBuilderInternal instantiates a new MailFolderItemRequestBuilder and sets the default values. +func NewMailFolderItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderItemRequestBuilder) { + m := &MailFolderItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}{?select}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMailFolderRequestBuilder instantiates a new MailFolderRequestBuilder and sets the default values. -func NewMailFolderRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderRequestBuilder) { +// NewMailFolderItemRequestBuilder instantiates a new MailFolderItemRequestBuilder and sets the default values. +func NewMailFolderItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MailFolderItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMailFolderRequestBuilderInternal(urlParams, requestAdapter) + return NewMailFolderItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) CreateDeleteRequestInformation(options *MailFolderRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreateDeleteRequestInformation(options *MailFolderItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -112,7 +111,7 @@ func (m *MailFolderRequestBuilder) CreateDeleteRequestInformation(options *MailF return requestInfo, nil } // CreateGetRequestInformation the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) CreateGetRequestInformation(options *MailFolderRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreateGetRequestInformation(options *MailFolderItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -132,7 +131,7 @@ func (m *MailFolderRequestBuilder) CreateGetRequestInformation(options *MailFold return requestInfo, nil } // CreatePatchRequestInformation the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) CreatePatchRequestInformation(options *MailFolderRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MailFolderItemRequestBuilder) CreatePatchRequestInformation(options *MailFolderItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -150,34 +149,34 @@ func (m *MailFolderRequestBuilder) CreatePatchRequestInformation(options *MailFo return requestInfo, nil } // Delete the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) Delete(options *MailFolderRequestBuilderDeleteOptions)(error) { +func (m *MailFolderItemRequestBuilder) Delete(options *MailFolderItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) Get(options *MailFolderRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, error) { +func (m *MailFolderItemRequestBuilder) Get(options *MailFolderItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable), nil } -func (m *MailFolderRequestBuilder) MessageRules()(*i8292dd9b1a0fee9945f96685dd56cd53e49fea510defe9e9be5f718692b7780b.MessageRulesRequestBuilder) { +func (m *MailFolderItemRequestBuilder) MessageRules()(*i8292dd9b1a0fee9945f96685dd56cd53e49fea510defe9e9be5f718692b7780b.MessageRulesRequestBuilder) { return i8292dd9b1a0fee9945f96685dd56cd53e49fea510defe9e9be5f718692b7780b.NewMessageRulesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MessageRulesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messageRules.item collection -func (m *MailFolderRequestBuilder) MessageRulesById(id string)(*i0fbca58a8d08af34163fee8e520aa4597b6c44f81ff3cfb5f35e29bcdca13621.MessageRuleRequestBuilder) { +func (m *MailFolderItemRequestBuilder) MessageRulesById(id string)(*i0fbca58a8d08af34163fee8e520aa4597b6c44f81ff3cfb5f35e29bcdca13621.MessageRuleItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -185,13 +184,13 @@ func (m *MailFolderRequestBuilder) MessageRulesById(id string)(*i0fbca58a8d08af3 if id != "" { urlTplParams["messageRule_id"] = id } - return i0fbca58a8d08af34163fee8e520aa4597b6c44f81ff3cfb5f35e29bcdca13621.NewMessageRuleRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i0fbca58a8d08af34163fee8e520aa4597b6c44f81ff3cfb5f35e29bcdca13621.NewMessageRuleItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -func (m *MailFolderRequestBuilder) Messages()(*ifde4ccdcab963c649b4bf69fc48707d15a301d0c5085720fb9c273d0b6fdab37.MessagesRequestBuilder) { +func (m *MailFolderItemRequestBuilder) Messages()(*ifde4ccdcab963c649b4bf69fc48707d15a301d0c5085720fb9c273d0b6fdab37.MessagesRequestBuilder) { return ifde4ccdcab963c649b4bf69fc48707d15a301d0c5085720fb9c273d0b6fdab37.NewMessagesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MessagesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messages.item collection -func (m *MailFolderRequestBuilder) MessagesById(id string)(*id9e66f56b6b4a00e301a4a3f0507d126e9c676567ee5351fbae1f29bdf7542a1.MessageRequestBuilder) { +func (m *MailFolderItemRequestBuilder) MessagesById(id string)(*id9e66f56b6b4a00e301a4a3f0507d126e9c676567ee5351fbae1f29bdf7542a1.MessageItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -199,13 +198,13 @@ func (m *MailFolderRequestBuilder) MessagesById(id string)(*id9e66f56b6b4a00e301 if id != "" { urlTplParams["message_id"] = id } - return id9e66f56b6b4a00e301a4a3f0507d126e9c676567ee5351fbae1f29bdf7542a1.NewMessageRequestBuilderInternal(urlTplParams, m.requestAdapter); + return id9e66f56b6b4a00e301a4a3f0507d126e9c676567ee5351fbae1f29bdf7542a1.NewMessageItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -func (m *MailFolderRequestBuilder) MultiValueExtendedProperties()(*i9edbc9e69c9374a312359d6ba60470f270b3741c34a0b8bf1d40a0b0997e5c7b.MultiValueExtendedPropertiesRequestBuilder) { +func (m *MailFolderItemRequestBuilder) MultiValueExtendedProperties()(*i9edbc9e69c9374a312359d6ba60470f270b3741c34a0b8bf1d40a0b0997e5c7b.MultiValueExtendedPropertiesRequestBuilder) { return i9edbc9e69c9374a312359d6ba60470f270b3741c34a0b8bf1d40a0b0997e5c7b.NewMultiValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MultiValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.multiValueExtendedProperties.item collection -func (m *MailFolderRequestBuilder) MultiValueExtendedPropertiesById(id string)(*i33ecd413f6751e2cbf414d6016f0af76590db7141528c4aac7ee62c4cb3c4bcc.MultiValueLegacyExtendedPropertyRequestBuilder) { +func (m *MailFolderItemRequestBuilder) MultiValueExtendedPropertiesById(id string)(*i33ecd413f6751e2cbf414d6016f0af76590db7141528c4aac7ee62c4cb3c4bcc.MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -213,25 +212,25 @@ func (m *MailFolderRequestBuilder) MultiValueExtendedPropertiesById(id string)(* if id != "" { urlTplParams["multiValueLegacyExtendedProperty_id"] = id } - return i33ecd413f6751e2cbf414d6016f0af76590db7141528c4aac7ee62c4cb3c4bcc.NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i33ecd413f6751e2cbf414d6016f0af76590db7141528c4aac7ee62c4cb3c4bcc.NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Patch the user's mail folders. Read-only. Nullable. -func (m *MailFolderRequestBuilder) Patch(options *MailFolderRequestBuilderPatchOptions)(error) { +func (m *MailFolderItemRequestBuilder) Patch(options *MailFolderItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } -func (m *MailFolderRequestBuilder) SingleValueExtendedProperties()(*i813340affbf9a598103dd11e02bd85608be12b91284a30d07f60a1aac1a263e6.SingleValueExtendedPropertiesRequestBuilder) { +func (m *MailFolderItemRequestBuilder) SingleValueExtendedProperties()(*i813340affbf9a598103dd11e02bd85608be12b91284a30d07f60a1aac1a263e6.SingleValueExtendedPropertiesRequestBuilder) { return i813340affbf9a598103dd11e02bd85608be12b91284a30d07f60a1aac1a263e6.NewSingleValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // SingleValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.singleValueExtendedProperties.item collection -func (m *MailFolderRequestBuilder) SingleValueExtendedPropertiesById(id string)(*idbb7dc5e3b94a6671fc2fde24821fbe6f90b0bfdd4d8781f45540e2e3d778e66.SingleValueLegacyExtendedPropertyRequestBuilder) { +func (m *MailFolderItemRequestBuilder) SingleValueExtendedPropertiesById(id string)(*idbb7dc5e3b94a6671fc2fde24821fbe6f90b0bfdd4d8781f45540e2e3d778e66.SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -239,5 +238,5 @@ func (m *MailFolderRequestBuilder) SingleValueExtendedPropertiesById(id string)( if id != "" { urlTplParams["singleValueLegacyExtendedProperty_id"] = id } - return idbb7dc5e3b94a6671fc2fde24821fbe6f90b0bfdd4d8781f45540e2e3d778e66.NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return idbb7dc5e3b94a6671fc2fde24821fbe6f90b0bfdd4d8781f45540e2e3d778e66.NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_item_request_builder.go index 574abebe6..7c55e508d 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/item/message_rule_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// MessageRuleRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messageRules\{messageRule-id} -type MessageRuleRequestBuilder struct { +// MessageRuleItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messageRules\{messageRule-id} +type MessageRuleItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type MessageRuleRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MessageRuleRequestBuilderDeleteOptions options for Delete -type MessageRuleRequestBuilderDeleteOptions struct { +// MessageRuleItemRequestBuilderDeleteOptions options for Delete +type MessageRuleItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,26 +23,26 @@ type MessageRuleRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRuleRequestBuilderGetOptions options for Get -type MessageRuleRequestBuilderGetOptions struct { +// MessageRuleItemRequestBuilderGetOptions options for Get +type MessageRuleItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MessageRuleRequestBuilderGetQueryParameters; + Q *MessageRuleItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRuleRequestBuilderGetQueryParameters the collection of rules that apply to the user's Inbox folder. -type MessageRuleRequestBuilderGetQueryParameters struct { +// MessageRuleItemRequestBuilderGetQueryParameters the collection of rules that apply to the user's Inbox folder. +type MessageRuleItemRequestBuilderGetQueryParameters struct { // Select properties to be returned Select []string; } -// MessageRuleRequestBuilderPatchOptions options for Patch -type MessageRuleRequestBuilderPatchOptions struct { +// MessageRuleItemRequestBuilderPatchOptions options for Patch +type MessageRuleItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable; // Request headers H map[string]string; // Request options @@ -51,27 +50,27 @@ type MessageRuleRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewMessageRuleRequestBuilderInternal instantiates a new MessageRuleRequestBuilder and sets the default values. -func NewMessageRuleRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRuleRequestBuilder) { - m := &MessageRuleRequestBuilder{ +// NewMessageRuleItemRequestBuilderInternal instantiates a new MessageRuleItemRequestBuilder and sets the default values. +func NewMessageRuleItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRuleItemRequestBuilder) { + m := &MessageRuleItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules/{messageRule_id}{?select}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMessageRuleRequestBuilder instantiates a new MessageRuleRequestBuilder and sets the default values. -func NewMessageRuleRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRuleRequestBuilder) { +// NewMessageRuleItemRequestBuilder instantiates a new MessageRuleItemRequestBuilder and sets the default values. +func NewMessageRuleItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRuleItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMessageRuleRequestBuilderInternal(urlParams, requestAdapter) + return NewMessageRuleItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) CreateDeleteRequestInformation(options *MessageRuleRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageRuleItemRequestBuilder) CreateDeleteRequestInformation(options *MessageRuleItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -88,7 +87,7 @@ func (m *MessageRuleRequestBuilder) CreateDeleteRequestInformation(options *Mess return requestInfo, nil } // CreateGetRequestInformation the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) CreateGetRequestInformation(options *MessageRuleRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageRuleItemRequestBuilder) CreateGetRequestInformation(options *MessageRuleItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -108,7 +107,7 @@ func (m *MessageRuleRequestBuilder) CreateGetRequestInformation(options *Message return requestInfo, nil } // CreatePatchRequestInformation the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) CreatePatchRequestInformation(options *MessageRuleRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageRuleItemRequestBuilder) CreatePatchRequestInformation(options *MessageRuleItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -126,36 +125,36 @@ func (m *MessageRuleRequestBuilder) CreatePatchRequestInformation(options *Messa return requestInfo, nil } // Delete the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) Delete(options *MessageRuleRequestBuilderDeleteOptions)(error) { +func (m *MessageRuleItemRequestBuilder) Delete(options *MessageRuleItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) Get(options *MessageRuleRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule, error) { +func (m *MessageRuleItemRequestBuilder) Get(options *MessageRuleItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessageRule() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageRuleFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable), nil } // Patch the collection of rules that apply to the user's Inbox folder. -func (m *MessageRuleRequestBuilder) Patch(options *MessageRuleRequestBuilderPatchOptions)(error) { +func (m *MessageRuleItemRequestBuilder) Patch(options *MessageRuleItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_request_builder.go index 2918d4df3..9de418ca2 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_request_builder.go @@ -2,7 +2,6 @@ package messagerules import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -44,7 +43,7 @@ type MessageRulesRequestBuilderGetQueryParameters struct { // MessageRulesRequestBuilderPostOptions options for Post type MessageRulesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable; // Request headers H map[string]string; // Request options @@ -61,7 +60,7 @@ func NewMessageRulesRequestBuilderInternal(pathParameters map[string]string, req for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -110,26 +109,26 @@ func (m *MessageRulesRequestBuilder) CreatePostRequestInformation(options *Messa return requestInfo, nil } // Get the collection of rules that apply to the user's Inbox folder. -func (m *MessageRulesRequestBuilder) Get(options *MessageRulesRequestBuilderGetOptions)(*MessageRulesResponse, error) { +func (m *MessageRulesRequestBuilder) Get(options *MessageRulesRequestBuilderGetOptions)(MessageRulesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessageRulesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMessageRulesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MessageRulesResponse), nil + return res.(MessageRulesResponseable), nil } // Post the collection of rules that apply to the user's Inbox folder. -func (m *MessageRulesRequestBuilder) Post(options *MessageRulesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule, error) { +func (m *MessageRulesRequestBuilder) Post(options *MessageRulesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessageRule() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageRuleFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_response.go index f20647090..afc12e362 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_response.go @@ -12,7 +12,7 @@ type MessageRulesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable; } // NewMessageRulesResponse instantiates a new messageRulesResponse and sets the default values. func NewMessageRulesResponse()(*MessageRulesResponse) { @@ -21,6 +21,10 @@ func NewMessageRulesResponse()(*MessageRulesResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMessageRulesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessageRulesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessageRulesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MessageRulesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MessageRulesResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MessageRulesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MessageRulesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessageRulesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MessageRulesResponse) GetFieldDeserializers()(map[string]func(interface return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessageRule() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageRuleFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MessageRulesResponse) GetFieldDeserializers()(map[string]func(interface } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MessageRulesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MessageRulesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MessageRulesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MessageRulesResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MessageRulesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MessageRulesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRule)() { +func (m *MessageRulesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_responseable.go new file mode 100644 index 000000000..807cd6404 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messagerules/message_rules_responseable.go @@ -0,0 +1,15 @@ +package messagerules + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MessageRulesResponseable +type MessageRulesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MessageRuleable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_request_builder.go index da8133c87..20e8ec5b0 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_request_builder.go @@ -2,7 +2,6 @@ package attachments import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type AttachmentsRequestBuilderGetQueryParameters struct { // AttachmentsRequestBuilderPostOptions options for Post type AttachmentsRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewAttachmentsRequestBuilderInternal(pathParameters map[string]string, requ for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *AttachmentsRequestBuilder) CreatePostRequestInformation(options *Attach return requestInfo, nil } // Get the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentsRequestBuilder) Get(options *AttachmentsRequestBuilderGetOptions)(*AttachmentsResponse, error) { +func (m *AttachmentsRequestBuilder) Get(options *AttachmentsRequestBuilderGetOptions)(AttachmentsResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewAttachmentsResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateAttachmentsResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*AttachmentsResponse), nil + return res.(AttachmentsResponseable), nil } // Post the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentsRequestBuilder) Post(options *AttachmentsRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, error) { +func (m *AttachmentsRequestBuilder) Post(options *AttachmentsRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_response.go index 21ec9d43c..5e60be3c8 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_response.go @@ -12,7 +12,7 @@ type AttachmentsResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; } // NewAttachmentsResponse instantiates a new attachmentsResponse and sets the default values. func NewAttachmentsResponse()(*AttachmentsResponse) { @@ -21,6 +21,10 @@ func NewAttachmentsResponse()(*AttachmentsResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateAttachmentsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateAttachmentsResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewAttachmentsResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *AttachmentsResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *AttachmentsResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *AttachmentsResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *AttachmentsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{ return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{ } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *AttachmentsResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *AttachmentsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *AttachmentsResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *AttachmentsResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *AttachmentsResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *AttachmentsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment)() { +func (m *AttachmentsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_responseable.go new file mode 100644 index 000000000..e380a2c78 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/attachments_responseable.go @@ -0,0 +1,15 @@ +package attachments + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// AttachmentsResponseable +type AttachmentsResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_item_request_builder.go index 497ff248a..3863d7b9e 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/attachments/item/attachment_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// AttachmentRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\attachments\{attachment-id} -type AttachmentRequestBuilder struct { +// AttachmentItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\attachments\{attachment-id} +type AttachmentItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type AttachmentRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// AttachmentRequestBuilderDeleteOptions options for Delete -type AttachmentRequestBuilderDeleteOptions struct { +// AttachmentItemRequestBuilderDeleteOptions options for Delete +type AttachmentItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type AttachmentRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// AttachmentRequestBuilderGetOptions options for Get -type AttachmentRequestBuilderGetOptions struct { +// AttachmentItemRequestBuilderGetOptions options for Get +type AttachmentItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *AttachmentRequestBuilderGetQueryParameters; + Q *AttachmentItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// AttachmentRequestBuilderGetQueryParameters the fileAttachment and itemAttachment attachments for the message. -type AttachmentRequestBuilderGetQueryParameters struct { +// AttachmentItemRequestBuilderGetQueryParameters the fileAttachment and itemAttachment attachments for the message. +type AttachmentItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// AttachmentRequestBuilderPatchOptions options for Patch -type AttachmentRequestBuilderPatchOptions struct { +// AttachmentItemRequestBuilderPatchOptions options for Patch +type AttachmentItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type AttachmentRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewAttachmentRequestBuilderInternal instantiates a new AttachmentRequestBuilder and sets the default values. -func NewAttachmentRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentRequestBuilder) { - m := &AttachmentRequestBuilder{ +// NewAttachmentItemRequestBuilderInternal instantiates a new AttachmentItemRequestBuilder and sets the default values. +func NewAttachmentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentItemRequestBuilder) { + m := &AttachmentItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewAttachmentRequestBuilder instantiates a new AttachmentRequestBuilder and sets the default values. -func NewAttachmentRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentRequestBuilder) { +// NewAttachmentItemRequestBuilder instantiates a new AttachmentItemRequestBuilder and sets the default values. +func NewAttachmentItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewAttachmentRequestBuilderInternal(urlParams, requestAdapter) + return NewAttachmentItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreateDeleteRequestInformation(options *AttachmentRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreateDeleteRequestInformation(options *AttachmentItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *AttachmentRequestBuilder) CreateDeleteRequestInformation(options *Attac return requestInfo, nil } // CreateGetRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreateGetRequestInformation(options *AttachmentRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreateGetRequestInformation(options *AttachmentItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *AttachmentRequestBuilder) CreateGetRequestInformation(options *Attachme return requestInfo, nil } // CreatePatchRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreatePatchRequestInformation(options *AttachmentRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreatePatchRequestInformation(options *AttachmentItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *AttachmentRequestBuilder) CreatePatchRequestInformation(options *Attach return requestInfo, nil } // Delete the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Delete(options *AttachmentRequestBuilderDeleteOptions)(error) { +func (m *AttachmentItemRequestBuilder) Delete(options *AttachmentItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Get(options *AttachmentRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, error) { +func (m *AttachmentItemRequestBuilder) Get(options *AttachmentItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable), nil } // Patch the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Patch(options *AttachmentRequestBuilderPatchOptions)(error) { +func (m *AttachmentItemRequestBuilder) Patch(options *AttachmentItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_request_builder.go index 414e12641..ae57b27ea 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_request_builder.go @@ -2,7 +2,6 @@ package extensions import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type ExtensionsRequestBuilderGetQueryParameters struct { // ExtensionsRequestBuilderPostOptions options for Post type ExtensionsRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewExtensionsRequestBuilderInternal(pathParameters map[string]string, reque for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *ExtensionsRequestBuilder) CreatePostRequestInformation(options *Extensi return requestInfo, nil } // Get the collection of open extensions defined for the message. Nullable. -func (m *ExtensionsRequestBuilder) Get(options *ExtensionsRequestBuilderGetOptions)(*ExtensionsResponse, error) { +func (m *ExtensionsRequestBuilder) Get(options *ExtensionsRequestBuilderGetOptions)(ExtensionsResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewExtensionsResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateExtensionsResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*ExtensionsResponse), nil + return res.(ExtensionsResponseable), nil } // Post the collection of open extensions defined for the message. Nullable. -func (m *ExtensionsRequestBuilder) Post(options *ExtensionsRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, error) { +func (m *ExtensionsRequestBuilder) Post(options *ExtensionsRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_response.go index a8b53f09e..a99a1643f 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_response.go @@ -12,7 +12,7 @@ type ExtensionsResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; } // NewExtensionsResponse instantiates a new extensionsResponse and sets the default values. func NewExtensionsResponse()(*ExtensionsResponse) { @@ -21,6 +21,10 @@ func NewExtensionsResponse()(*ExtensionsResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateExtensionsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateExtensionsResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewExtensionsResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *ExtensionsResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *ExtensionsResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *ExtensionsResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *ExtensionsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{} return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{} } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *ExtensionsResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *ExtensionsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *ExtensionsResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *ExtensionsResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *ExtensionsResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *ExtensionsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension)() { +func (m *ExtensionsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_responseable.go new file mode 100644 index 000000000..717ba2e65 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/extensions_responseable.go @@ -0,0 +1,15 @@ +package extensions + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// ExtensionsResponseable +type ExtensionsResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_item_request_builder.go index 8c2facb9a..fe9ac7b2a 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item/extension_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// ExtensionRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\extensions\{extension-id} -type ExtensionRequestBuilder struct { +// ExtensionItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\extensions\{extension-id} +type ExtensionItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type ExtensionRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// ExtensionRequestBuilderDeleteOptions options for Delete -type ExtensionRequestBuilderDeleteOptions struct { +// ExtensionItemRequestBuilderDeleteOptions options for Delete +type ExtensionItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type ExtensionRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// ExtensionRequestBuilderGetOptions options for Get -type ExtensionRequestBuilderGetOptions struct { +// ExtensionItemRequestBuilderGetOptions options for Get +type ExtensionItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *ExtensionRequestBuilderGetQueryParameters; + Q *ExtensionItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// ExtensionRequestBuilderGetQueryParameters the collection of open extensions defined for the message. Nullable. -type ExtensionRequestBuilderGetQueryParameters struct { +// ExtensionItemRequestBuilderGetQueryParameters the collection of open extensions defined for the message. Nullable. +type ExtensionItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// ExtensionRequestBuilderPatchOptions options for Patch -type ExtensionRequestBuilderPatchOptions struct { +// ExtensionItemRequestBuilderPatchOptions options for Patch +type ExtensionItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type ExtensionRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewExtensionRequestBuilderInternal instantiates a new ExtensionRequestBuilder and sets the default values. -func NewExtensionRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionRequestBuilder) { - m := &ExtensionRequestBuilder{ +// NewExtensionItemRequestBuilderInternal instantiates a new ExtensionItemRequestBuilder and sets the default values. +func NewExtensionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionItemRequestBuilder) { + m := &ExtensionItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewExtensionRequestBuilder instantiates a new ExtensionRequestBuilder and sets the default values. -func NewExtensionRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionRequestBuilder) { +// NewExtensionItemRequestBuilder instantiates a new ExtensionItemRequestBuilder and sets the default values. +func NewExtensionItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewExtensionRequestBuilderInternal(urlParams, requestAdapter) + return NewExtensionItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreateDeleteRequestInformation(options *ExtensionRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreateDeleteRequestInformation(options *ExtensionItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *ExtensionRequestBuilder) CreateDeleteRequestInformation(options *Extens return requestInfo, nil } // CreateGetRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreateGetRequestInformation(options *ExtensionRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreateGetRequestInformation(options *ExtensionItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *ExtensionRequestBuilder) CreateGetRequestInformation(options *Extension return requestInfo, nil } // CreatePatchRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreatePatchRequestInformation(options *ExtensionRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreatePatchRequestInformation(options *ExtensionItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *ExtensionRequestBuilder) CreatePatchRequestInformation(options *Extensi return requestInfo, nil } // Delete the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Delete(options *ExtensionRequestBuilderDeleteOptions)(error) { +func (m *ExtensionItemRequestBuilder) Delete(options *ExtensionItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Get(options *ExtensionRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, error) { +func (m *ExtensionItemRequestBuilder) Get(options *ExtensionItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable), nil } // Patch the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Patch(options *ExtensionRequestBuilderPatchOptions)(error) { +func (m *ExtensionItemRequestBuilder) Patch(options *ExtensionItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_item_request_builder.go similarity index 66% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_item_request_builder.go index f2c7bde2c..664bed12a 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/message_item_request_builder.go @@ -2,7 +2,6 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" i000de88af33510156072c580aff36ddc934a6dbf385120aee0662cecf92dfee6 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/value" i165e60b62d06f92d5e6029daee4ae129b1c3d1780dce2631cc18fbe8c6d39c9d "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties" @@ -15,8 +14,8 @@ import ( icb423aed2922bb0caf9a0353a5ec5bfeb474588dbd1218008894e86ab49c6e25 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/extensions/item" ) -// MessageRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id} -type MessageRequestBuilder struct { +// MessageItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id} +type MessageItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -24,8 +23,8 @@ type MessageRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MessageRequestBuilderDeleteOptions options for Delete -type MessageRequestBuilderDeleteOptions struct { +// MessageItemRequestBuilderDeleteOptions options for Delete +type MessageItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -33,28 +32,28 @@ type MessageRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRequestBuilderGetOptions options for Get -type MessageRequestBuilderGetOptions struct { +// MessageItemRequestBuilderGetOptions options for Get +type MessageItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MessageRequestBuilderGetQueryParameters; + Q *MessageItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRequestBuilderGetQueryParameters the collection of messages in the mailFolder. -type MessageRequestBuilderGetQueryParameters struct { +// MessageItemRequestBuilderGetQueryParameters the collection of messages in the mailFolder. +type MessageItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// MessageRequestBuilderPatchOptions options for Patch -type MessageRequestBuilderPatchOptions struct { +// MessageItemRequestBuilderPatchOptions options for Patch +type MessageItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; // Request headers H map[string]string; // Request options @@ -62,11 +61,11 @@ type MessageRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -func (m *MessageRequestBuilder) Attachments()(*i9b8e8e1d8c7f8c0fa45b5abe65e2541be081536bd338e75409f4b0ecba2188aa.AttachmentsRequestBuilder) { +func (m *MessageItemRequestBuilder) Attachments()(*i9b8e8e1d8c7f8c0fa45b5abe65e2541be081536bd338e75409f4b0ecba2188aa.AttachmentsRequestBuilder) { return i9b8e8e1d8c7f8c0fa45b5abe65e2541be081536bd338e75409f4b0ecba2188aa.NewAttachmentsRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // AttachmentsById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messages.item.attachments.item collection -func (m *MessageRequestBuilder) AttachmentsById(id string)(*i92b891944e73393404194faa96a7587068f07492bd44347d827c18456b8a2bcf.AttachmentRequestBuilder) { +func (m *MessageItemRequestBuilder) AttachmentsById(id string)(*i92b891944e73393404194faa96a7587068f07492bd44347d827c18456b8a2bcf.AttachmentItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -74,32 +73,32 @@ func (m *MessageRequestBuilder) AttachmentsById(id string)(*i92b891944e733934041 if id != "" { urlTplParams["attachment_id"] = id } - return i92b891944e73393404194faa96a7587068f07492bd44347d827c18456b8a2bcf.NewAttachmentRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i92b891944e73393404194faa96a7587068f07492bd44347d827c18456b8a2bcf.NewAttachmentItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -// NewMessageRequestBuilderInternal instantiates a new MessageRequestBuilder and sets the default values. -func NewMessageRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRequestBuilder) { - m := &MessageRequestBuilder{ +// NewMessageItemRequestBuilderInternal instantiates a new MessageItemRequestBuilder and sets the default values. +func NewMessageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageItemRequestBuilder) { + m := &MessageItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMessageRequestBuilder instantiates a new MessageRequestBuilder and sets the default values. -func NewMessageRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRequestBuilder) { +// NewMessageItemRequestBuilder instantiates a new MessageItemRequestBuilder and sets the default values. +func NewMessageItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMessageRequestBuilderInternal(urlParams, requestAdapter) + return NewMessageItemRequestBuilderInternal(urlParams, requestAdapter) } -func (m *MessageRequestBuilder) Content()(*i000de88af33510156072c580aff36ddc934a6dbf385120aee0662cecf92dfee6.ContentRequestBuilder) { +func (m *MessageItemRequestBuilder) Content()(*i000de88af33510156072c580aff36ddc934a6dbf385120aee0662cecf92dfee6.ContentRequestBuilder) { return i000de88af33510156072c580aff36ddc934a6dbf385120aee0662cecf92dfee6.NewContentRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // CreateDeleteRequestInformation the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) CreateDeleteRequestInformation(options *MessageRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreateDeleteRequestInformation(options *MessageItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -116,7 +115,7 @@ func (m *MessageRequestBuilder) CreateDeleteRequestInformation(options *MessageR return requestInfo, nil } // CreateGetRequestInformation the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) CreateGetRequestInformation(options *MessageRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreateGetRequestInformation(options *MessageItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -136,7 +135,7 @@ func (m *MessageRequestBuilder) CreateGetRequestInformation(options *MessageRequ return requestInfo, nil } // CreatePatchRequestInformation the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) CreatePatchRequestInformation(options *MessageRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreatePatchRequestInformation(options *MessageItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -154,22 +153,22 @@ func (m *MessageRequestBuilder) CreatePatchRequestInformation(options *MessageRe return requestInfo, nil } // Delete the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) Delete(options *MessageRequestBuilderDeleteOptions)(error) { +func (m *MessageItemRequestBuilder) Delete(options *MessageItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } -func (m *MessageRequestBuilder) Extensions()(*i281b692d3f673c995c16b5cc69287c818497fc74562aed972acc168040629f74.ExtensionsRequestBuilder) { +func (m *MessageItemRequestBuilder) Extensions()(*i281b692d3f673c995c16b5cc69287c818497fc74562aed972acc168040629f74.ExtensionsRequestBuilder) { return i281b692d3f673c995c16b5cc69287c818497fc74562aed972acc168040629f74.NewExtensionsRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // ExtensionsById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messages.item.extensions.item collection -func (m *MessageRequestBuilder) ExtensionsById(id string)(*icb423aed2922bb0caf9a0353a5ec5bfeb474588dbd1218008894e86ab49c6e25.ExtensionRequestBuilder) { +func (m *MessageItemRequestBuilder) ExtensionsById(id string)(*icb423aed2922bb0caf9a0353a5ec5bfeb474588dbd1218008894e86ab49c6e25.ExtensionItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -177,25 +176,25 @@ func (m *MessageRequestBuilder) ExtensionsById(id string)(*icb423aed2922bb0caf9a if id != "" { urlTplParams["extension_id"] = id } - return icb423aed2922bb0caf9a0353a5ec5bfeb474588dbd1218008894e86ab49c6e25.NewExtensionRequestBuilderInternal(urlTplParams, m.requestAdapter); + return icb423aed2922bb0caf9a0353a5ec5bfeb474588dbd1218008894e86ab49c6e25.NewExtensionItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Get the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) Get(options *MessageRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, error) { +func (m *MessageItemRequestBuilder) Get(options *MessageItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable), nil } -func (m *MessageRequestBuilder) MultiValueExtendedProperties()(*i165e60b62d06f92d5e6029daee4ae129b1c3d1780dce2631cc18fbe8c6d39c9d.MultiValueExtendedPropertiesRequestBuilder) { +func (m *MessageItemRequestBuilder) MultiValueExtendedProperties()(*i165e60b62d06f92d5e6029daee4ae129b1c3d1780dce2631cc18fbe8c6d39c9d.MultiValueExtendedPropertiesRequestBuilder) { return i165e60b62d06f92d5e6029daee4ae129b1c3d1780dce2631cc18fbe8c6d39c9d.NewMultiValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MultiValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item collection -func (m *MessageRequestBuilder) MultiValueExtendedPropertiesById(id string)(*i314a2a68928bac08cd3678f4259eab0e5845a67017fe63526811793a0c7a4615.MultiValueLegacyExtendedPropertyRequestBuilder) { +func (m *MessageItemRequestBuilder) MultiValueExtendedPropertiesById(id string)(*i314a2a68928bac08cd3678f4259eab0e5845a67017fe63526811793a0c7a4615.MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -203,25 +202,25 @@ func (m *MessageRequestBuilder) MultiValueExtendedPropertiesById(id string)(*i31 if id != "" { urlTplParams["multiValueLegacyExtendedProperty_id"] = id } - return i314a2a68928bac08cd3678f4259eab0e5845a67017fe63526811793a0c7a4615.NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i314a2a68928bac08cd3678f4259eab0e5845a67017fe63526811793a0c7a4615.NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Patch the collection of messages in the mailFolder. -func (m *MessageRequestBuilder) Patch(options *MessageRequestBuilderPatchOptions)(error) { +func (m *MessageItemRequestBuilder) Patch(options *MessageItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } -func (m *MessageRequestBuilder) SingleValueExtendedProperties()(*i833cf7d5250828d0b2288e87035b59c2900b4aef7c2eb2ff5494a38edea8268e.SingleValueExtendedPropertiesRequestBuilder) { +func (m *MessageItemRequestBuilder) SingleValueExtendedProperties()(*i833cf7d5250828d0b2288e87035b59c2900b4aef7c2eb2ff5494a38edea8268e.SingleValueExtendedPropertiesRequestBuilder) { return i833cf7d5250828d0b2288e87035b59c2900b4aef7c2eb2ff5494a38edea8268e.NewSingleValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // SingleValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item collection -func (m *MessageRequestBuilder) SingleValueExtendedPropertiesById(id string)(*ia3b46812df8e43b8356e8bad54f90359cc966c930f9415ac7f61670490ce857f.SingleValueLegacyExtendedPropertyRequestBuilder) { +func (m *MessageItemRequestBuilder) SingleValueExtendedPropertiesById(id string)(*ia3b46812df8e43b8356e8bad54f90359cc966c930f9415ac7f61670490ce857f.SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -229,5 +228,5 @@ func (m *MessageRequestBuilder) SingleValueExtendedPropertiesById(id string)(*ia if id != "" { urlTplParams["singleValueLegacyExtendedProperty_id"] = id } - return ia3b46812df8e43b8356e8bad54f90359cc966c930f9415ac7f61670490ce857f.NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return ia3b46812df8e43b8356e8bad54f90359cc966c930f9415ac7f61670490ce857f.NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go similarity index 57% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go index 4880bb994..64f0ecdf6 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// MultiValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} -type MultiValueLegacyExtendedPropertyRequestBuilder struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} +type MultiValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type MultiValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type MultiValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the message. Nullable. -type MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the message. Nullable. +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewMultiValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { - m := &MultiValueLegacyExtendedPropertyRequestBuilder{ +// NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { + m := &MultiValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMultiValueLegacyExtendedPropertyRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { +// NewMultiValueLegacyExtendedPropertyItemRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInfo return requestInfo, nil } // CreateGetRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInforma return requestInfo, nil } // CreatePatchRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfor return requestInfo, nil } // Delete the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } // Patch the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go index 269a81679..383171615 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package multivalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type MultiValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // MultiValueExtendedPropertiesRequestBuilderPostOptions options for Post type MultiValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewMultiValueExtendedPropertiesRequestBuilderInternal(pathParameters map[st for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *MultiValueExtendedPropertiesRequestBuilder) CreatePostRequestInformatio return requestInfo, nil } // Get the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(*MultiValueExtendedPropertiesResponse, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(MultiValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMultiValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MultiValueExtendedPropertiesResponse), nil + return res.(MultiValueExtendedPropertiesResponseable), nil } // Post the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go index 7ff4d88dc..fe45511e9 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go @@ -12,7 +12,7 @@ type MultiValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; } // NewMultiValueExtendedPropertiesResponse instantiates a new multiValueExtendedPropertiesResponse and sets the default values. func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResp m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMultiValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]in return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MultiValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MultiValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafad if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MultiValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)() { +func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go new file mode 100644 index 000000000..c6080a991 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package multivalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MultiValueExtendedPropertiesResponseable +type MultiValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go similarity index 57% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go index cfb8d9639..0e1b988b7 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// SingleValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} -type SingleValueLegacyExtendedPropertyRequestBuilder struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} +type SingleValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type SingleValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type SingleValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the message. Nullable. -type SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the message. Nullable. +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewSingleValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { - m := &SingleValueLegacyExtendedPropertyRequestBuilder{ +// NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { + m := &SingleValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewSingleValueLegacyExtendedPropertyRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { +// NewSingleValueLegacyExtendedPropertyItemRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInf return requestInfo, nil } // CreateGetRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInform return requestInfo, nil } // CreatePatchRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfo return requestInfo, nil } // Delete the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } // Patch the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go index 9e145b794..dfcf0c96f 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package singlevalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type SingleValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // SingleValueExtendedPropertiesRequestBuilderPostOptions options for Post type SingleValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewSingleValueExtendedPropertiesRequestBuilderInternal(pathParameters map[s for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *SingleValueExtendedPropertiesRequestBuilder) CreatePostRequestInformati return requestInfo, nil } // Get the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(*SingleValueExtendedPropertiesResponse, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(SingleValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSingleValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*SingleValueExtendedPropertiesResponse), nil + return res.(SingleValueExtendedPropertiesResponseable), nil } // Post the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go index f69ef5fdc..1a730d6ae 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go @@ -12,7 +12,7 @@ type SingleValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; } // NewSingleValueExtendedPropertiesResponse instantiates a new singleValueExtendedPropertiesResponse and sets the default values. func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesRe m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewSingleValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]i return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *SingleValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *SingleValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafa if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *SingleValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)() { +func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go new file mode 100644 index 000000000..aea4fd899 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package singlevalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// SingleValueExtendedPropertiesResponseable +type SingleValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/value/content_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/value/content_request_builder.go index 16e1f9da8..93c32586c 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/value/content_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/item/value/content_request_builder.go @@ -42,7 +42,7 @@ func NewContentRequestBuilderInternal(pathParameters map[string]string, requestA for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -93,7 +93,7 @@ func (m *ContentRequestBuilder) Get(options *ContentRequestBuilderGetOptions)([] if err != nil { return nil, err } - res, err := m.requestAdapter.SendPrimitiveAsync(*requestInfo, "byte", nil) + res, err := m.requestAdapter.SendPrimitiveAsync(*requestInfo, "byte", nil, nil) if err != nil { return nil, err } @@ -105,7 +105,7 @@ func (m *ContentRequestBuilder) Put(options *ContentRequestBuilderPutOptions)(er if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_request_builder.go index 66eb835cb..6ea2696e3 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_request_builder.go @@ -2,7 +2,6 @@ package messages import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type MessagesRequestBuilderGetQueryParameters struct { // MessagesRequestBuilderPostOptions options for Post type MessagesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewMessagesRequestBuilderInternal(pathParameters map[string]string, request for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *MessagesRequestBuilder) CreatePostRequestInformation(options *MessagesR return requestInfo, nil } // Get the collection of messages in the mailFolder. -func (m *MessagesRequestBuilder) Get(options *MessagesRequestBuilderGetOptions)(*MessagesResponse, error) { +func (m *MessagesRequestBuilder) Get(options *MessagesRequestBuilderGetOptions)(MessagesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessagesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMessagesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MessagesResponse), nil + return res.(MessagesResponseable), nil } // Post the collection of messages in the mailFolder. -func (m *MessagesRequestBuilder) Post(options *MessagesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, error) { +func (m *MessagesRequestBuilder) Post(options *MessagesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_response.go index e77c40f89..2da751bfd 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_response.go @@ -12,7 +12,7 @@ type MessagesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; } // NewMessagesResponse instantiates a new messagesResponse and sets the default values. func NewMessagesResponse()(*MessagesResponse) { @@ -21,6 +21,10 @@ func NewMessagesResponse()(*MessagesResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMessagesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessagesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessagesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MessagesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MessagesResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MessagesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MessagesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MessagesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MessagesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MessagesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MessagesResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b26 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MessagesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MessagesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message)() { +func (m *MessagesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_responseable.go new file mode 100644 index 000000000..2fdc56522 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/messages/messages_responseable.go @@ -0,0 +1,15 @@ +package messages + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MessagesResponseable +type MessagesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go similarity index 58% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go index 22b5e6431..b4cac23cb 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// MultiValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} -type MultiValueLegacyExtendedPropertyRequestBuilder struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} +type MultiValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type MultiValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type MultiValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -type MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewMultiValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { - m := &MultiValueLegacyExtendedPropertyRequestBuilder{ +// NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { + m := &MultiValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMultiValueLegacyExtendedPropertyRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { +// NewMultiValueLegacyExtendedPropertyItemRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInfo return requestInfo, nil } // CreateGetRequestInformation the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInforma return requestInfo, nil } // CreatePatchRequestInformation the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfor return requestInfo, nil } // Delete the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } // Patch the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go index 07216a12b..12fcc4e2d 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package multivalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type MultiValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // MultiValueExtendedPropertiesRequestBuilderPostOptions options for Post type MultiValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewMultiValueExtendedPropertiesRequestBuilderInternal(pathParameters map[st for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *MultiValueExtendedPropertiesRequestBuilder) CreatePostRequestInformatio return requestInfo, nil } // Get the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(*MultiValueExtendedPropertiesResponse, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(MultiValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMultiValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MultiValueExtendedPropertiesResponse), nil + return res.(MultiValueExtendedPropertiesResponseable), nil } // Post the collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_response.go index 7ff4d88dc..fe45511e9 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_response.go @@ -12,7 +12,7 @@ type MultiValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; } // NewMultiValueExtendedPropertiesResponse instantiates a new multiValueExtendedPropertiesResponse and sets the default values. func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResp m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMultiValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]in return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MultiValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MultiValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafad if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MultiValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)() { +func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go new file mode 100644 index 000000000..c6080a991 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package multivalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MultiValueExtendedPropertiesResponseable +type MultiValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go similarity index 57% rename from msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go index 1842fc17c..ca49a462a 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// SingleValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} -type SingleValueLegacyExtendedPropertyRequestBuilder struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\mailFolders\{mailFolder-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} +type SingleValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type SingleValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type SingleValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -type SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewSingleValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { - m := &SingleValueLegacyExtendedPropertyRequestBuilder{ +// NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { + m := &SingleValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewSingleValueLegacyExtendedPropertyRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { +// NewSingleValueLegacyExtendedPropertyItemRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInf return requestInfo, nil } // CreateGetRequestInformation the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInform return requestInfo, nil } // CreatePatchRequestInformation the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfo return requestInfo, nil } // Delete the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } // Patch the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go index 3f489df81..1939de047 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package singlevalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type SingleValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // SingleValueExtendedPropertiesRequestBuilderPostOptions options for Post type SingleValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewSingleValueExtendedPropertiesRequestBuilderInternal(pathParameters map[s for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *SingleValueExtendedPropertiesRequestBuilder) CreatePostRequestInformati return requestInfo, nil } // Get the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(*SingleValueExtendedPropertiesResponse, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(SingleValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSingleValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*SingleValueExtendedPropertiesResponse), nil + return res.(SingleValueExtendedPropertiesResponseable), nil } // Post the collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_response.go index f69ef5fdc..1a730d6ae 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_response.go @@ -12,7 +12,7 @@ type SingleValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; } // NewSingleValueExtendedPropertiesResponse instantiates a new singleValueExtendedPropertiesResponse and sets the default values. func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesRe m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewSingleValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]i return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *SingleValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *SingleValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafa if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *SingleValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)() { +func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go new file mode 100644 index 000000000..aea4fd899 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package singlevalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// SingleValueExtendedPropertiesResponseable +type SingleValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_request_builder.go b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_request_builder.go index d5e947569..e5566f4cf 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_request_builder.go @@ -2,7 +2,6 @@ package mailfolders import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -44,7 +43,7 @@ type MailFoldersRequestBuilderGetQueryParameters struct { // MailFoldersRequestBuilderPostOptions options for Post type MailFoldersRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; // Request headers H map[string]string; // Request options @@ -61,7 +60,7 @@ func NewMailFoldersRequestBuilderInternal(pathParameters map[string]string, requ for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -110,26 +109,26 @@ func (m *MailFoldersRequestBuilder) CreatePostRequestInformation(options *MailFo return requestInfo, nil } // Get the user's mail folders. Read-only. Nullable. -func (m *MailFoldersRequestBuilder) Get(options *MailFoldersRequestBuilderGetOptions)(*MailFoldersResponse, error) { +func (m *MailFoldersRequestBuilder) Get(options *MailFoldersRequestBuilderGetOptions)(MailFoldersResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMailFoldersResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMailFoldersResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MailFoldersResponse), nil + return res.(MailFoldersResponseable), nil } // Post the user's mail folders. Read-only. Nullable. -func (m *MailFoldersRequestBuilder) Post(options *MailFoldersRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, error) { +func (m *MailFoldersRequestBuilder) Post(options *MailFoldersRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable), nil } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_response.go b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_response.go index 72a75b376..36c546caa 100644 --- a/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_response.go +++ b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_response.go @@ -12,7 +12,7 @@ type MailFoldersResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable; } // NewMailFoldersResponse instantiates a new mailFoldersResponse and sets the default values. func NewMailFoldersResponse()(*MailFoldersResponse) { @@ -21,6 +21,10 @@ func NewMailFoldersResponse()(*MailFoldersResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMailFoldersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMailFoldersResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMailFoldersResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MailFoldersResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MailFoldersResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MailFoldersResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MailFoldersResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MailFoldersResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MailFoldersResponse) GetFieldDeserializers()(map[string]func(interface{ return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMailFolder() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMailFolderFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MailFoldersResponse) GetFieldDeserializers()(map[string]func(interface{ } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MailFoldersResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MailFoldersResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MailFoldersResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MailFoldersResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MailFoldersResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MailFoldersResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolder)() { +func (m *MailFoldersResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_responseable.go b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_responseable.go new file mode 100644 index 000000000..3088d9c69 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/mailfolders/mail_folders_responseable.go @@ -0,0 +1,15 @@ +package mailfolders + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MailFoldersResponseable +type MailFoldersResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MailFolderable)() +} diff --git a/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_request_builder.go index 18de457aa..6fab12c15 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_request_builder.go @@ -2,7 +2,6 @@ package attachments import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type AttachmentsRequestBuilderGetQueryParameters struct { // AttachmentsRequestBuilderPostOptions options for Post type AttachmentsRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewAttachmentsRequestBuilderInternal(pathParameters map[string]string, requ for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *AttachmentsRequestBuilder) CreatePostRequestInformation(options *Attach return requestInfo, nil } // Get the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentsRequestBuilder) Get(options *AttachmentsRequestBuilderGetOptions)(*AttachmentsResponse, error) { +func (m *AttachmentsRequestBuilder) Get(options *AttachmentsRequestBuilderGetOptions)(AttachmentsResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewAttachmentsResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateAttachmentsResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*AttachmentsResponse), nil + return res.(AttachmentsResponseable), nil } // Post the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentsRequestBuilder) Post(options *AttachmentsRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, error) { +func (m *AttachmentsRequestBuilder) Post(options *AttachmentsRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable), nil } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_response.go b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_response.go index 21ec9d43c..5e60be3c8 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_response.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_response.go @@ -12,7 +12,7 @@ type AttachmentsResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; } // NewAttachmentsResponse instantiates a new attachmentsResponse and sets the default values. func NewAttachmentsResponse()(*AttachmentsResponse) { @@ -21,6 +21,10 @@ func NewAttachmentsResponse()(*AttachmentsResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateAttachmentsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateAttachmentsResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewAttachmentsResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *AttachmentsResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *AttachmentsResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *AttachmentsResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *AttachmentsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{ return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *AttachmentsResponse) GetFieldDeserializers()(map[string]func(interface{ } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *AttachmentsResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *AttachmentsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *AttachmentsResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *AttachmentsResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *AttachmentsResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *AttachmentsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment)() { +func (m *AttachmentsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_responseable.go b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_responseable.go new file mode 100644 index 000000000..e380a2c78 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/messages/item/attachments/attachments_responseable.go @@ -0,0 +1,15 @@ +package attachments + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// AttachmentsResponseable +type AttachmentsResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable)() +} diff --git a/msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_request_builder.go rename to msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_item_request_builder.go index 61e8c31cf..35077bf96 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/attachments/item/attachment_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// AttachmentRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\attachments\{attachment-id} -type AttachmentRequestBuilder struct { +// AttachmentItemRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\attachments\{attachment-id} +type AttachmentItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type AttachmentRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// AttachmentRequestBuilderDeleteOptions options for Delete -type AttachmentRequestBuilderDeleteOptions struct { +// AttachmentItemRequestBuilderDeleteOptions options for Delete +type AttachmentItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type AttachmentRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// AttachmentRequestBuilderGetOptions options for Get -type AttachmentRequestBuilderGetOptions struct { +// AttachmentItemRequestBuilderGetOptions options for Get +type AttachmentItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *AttachmentRequestBuilderGetQueryParameters; + Q *AttachmentItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// AttachmentRequestBuilderGetQueryParameters the fileAttachment and itemAttachment attachments for the message. -type AttachmentRequestBuilderGetQueryParameters struct { +// AttachmentItemRequestBuilderGetQueryParameters the fileAttachment and itemAttachment attachments for the message. +type AttachmentItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// AttachmentRequestBuilderPatchOptions options for Patch -type AttachmentRequestBuilderPatchOptions struct { +// AttachmentItemRequestBuilderPatchOptions options for Patch +type AttachmentItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type AttachmentRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewAttachmentRequestBuilderInternal instantiates a new AttachmentRequestBuilder and sets the default values. -func NewAttachmentRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentRequestBuilder) { - m := &AttachmentRequestBuilder{ +// NewAttachmentItemRequestBuilderInternal instantiates a new AttachmentItemRequestBuilder and sets the default values. +func NewAttachmentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentItemRequestBuilder) { + m := &AttachmentItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewAttachmentRequestBuilder instantiates a new AttachmentRequestBuilder and sets the default values. -func NewAttachmentRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentRequestBuilder) { +// NewAttachmentItemRequestBuilder instantiates a new AttachmentItemRequestBuilder and sets the default values. +func NewAttachmentItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*AttachmentItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewAttachmentRequestBuilderInternal(urlParams, requestAdapter) + return NewAttachmentItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreateDeleteRequestInformation(options *AttachmentRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreateDeleteRequestInformation(options *AttachmentItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *AttachmentRequestBuilder) CreateDeleteRequestInformation(options *Attac return requestInfo, nil } // CreateGetRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreateGetRequestInformation(options *AttachmentRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreateGetRequestInformation(options *AttachmentItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *AttachmentRequestBuilder) CreateGetRequestInformation(options *Attachme return requestInfo, nil } // CreatePatchRequestInformation the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) CreatePatchRequestInformation(options *AttachmentRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *AttachmentItemRequestBuilder) CreatePatchRequestInformation(options *AttachmentItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *AttachmentRequestBuilder) CreatePatchRequestInformation(options *Attach return requestInfo, nil } // Delete the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Delete(options *AttachmentRequestBuilderDeleteOptions)(error) { +func (m *AttachmentItemRequestBuilder) Delete(options *AttachmentItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Get(options *AttachmentRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment, error) { +func (m *AttachmentItemRequestBuilder) Get(options *AttachmentItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewAttachment() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateAttachmentFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachment), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Attachmentable), nil } // Patch the fileAttachment and itemAttachment attachments for the message. -func (m *AttachmentRequestBuilder) Patch(options *AttachmentRequestBuilderPatchOptions)(error) { +func (m *AttachmentItemRequestBuilder) Patch(options *AttachmentItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_request_builder.go index d3fbafca8..4ff80a9c6 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_request_builder.go @@ -2,7 +2,6 @@ package extensions import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type ExtensionsRequestBuilderGetQueryParameters struct { // ExtensionsRequestBuilderPostOptions options for Post type ExtensionsRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewExtensionsRequestBuilderInternal(pathParameters map[string]string, reque for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *ExtensionsRequestBuilder) CreatePostRequestInformation(options *Extensi return requestInfo, nil } // Get the collection of open extensions defined for the message. Nullable. -func (m *ExtensionsRequestBuilder) Get(options *ExtensionsRequestBuilderGetOptions)(*ExtensionsResponse, error) { +func (m *ExtensionsRequestBuilder) Get(options *ExtensionsRequestBuilderGetOptions)(ExtensionsResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewExtensionsResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateExtensionsResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*ExtensionsResponse), nil + return res.(ExtensionsResponseable), nil } // Post the collection of open extensions defined for the message. Nullable. -func (m *ExtensionsRequestBuilder) Post(options *ExtensionsRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, error) { +func (m *ExtensionsRequestBuilder) Post(options *ExtensionsRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable), nil } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_response.go b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_response.go index a8b53f09e..a99a1643f 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_response.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_response.go @@ -12,7 +12,7 @@ type ExtensionsResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; } // NewExtensionsResponse instantiates a new extensionsResponse and sets the default values. func NewExtensionsResponse()(*ExtensionsResponse) { @@ -21,6 +21,10 @@ func NewExtensionsResponse()(*ExtensionsResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateExtensionsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateExtensionsResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewExtensionsResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *ExtensionsResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *ExtensionsResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *ExtensionsResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *ExtensionsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{} return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *ExtensionsResponse) GetFieldDeserializers()(map[string]func(interface{} } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *ExtensionsResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *ExtensionsResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *ExtensionsResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *ExtensionsResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *ExtensionsResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *ExtensionsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension)() { +func (m *ExtensionsResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_responseable.go b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_responseable.go new file mode 100644 index 000000000..717ba2e65 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/messages/item/extensions/extensions_responseable.go @@ -0,0 +1,15 @@ +package extensions + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// ExtensionsResponseable +type ExtensionsResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable)() +} diff --git a/msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_item_request_builder.go similarity index 63% rename from msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_request_builder.go rename to msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_item_request_builder.go index a2b9dbbb7..9319480a8 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/extensions/item/extension_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// ExtensionRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\extensions\{extension-id} -type ExtensionRequestBuilder struct { +// ExtensionItemRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\extensions\{extension-id} +type ExtensionItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type ExtensionRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// ExtensionRequestBuilderDeleteOptions options for Delete -type ExtensionRequestBuilderDeleteOptions struct { +// ExtensionItemRequestBuilderDeleteOptions options for Delete +type ExtensionItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type ExtensionRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// ExtensionRequestBuilderGetOptions options for Get -type ExtensionRequestBuilderGetOptions struct { +// ExtensionItemRequestBuilderGetOptions options for Get +type ExtensionItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *ExtensionRequestBuilderGetQueryParameters; + Q *ExtensionItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// ExtensionRequestBuilderGetQueryParameters the collection of open extensions defined for the message. Nullable. -type ExtensionRequestBuilderGetQueryParameters struct { +// ExtensionItemRequestBuilderGetQueryParameters the collection of open extensions defined for the message. Nullable. +type ExtensionItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// ExtensionRequestBuilderPatchOptions options for Patch -type ExtensionRequestBuilderPatchOptions struct { +// ExtensionItemRequestBuilderPatchOptions options for Patch +type ExtensionItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type ExtensionRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewExtensionRequestBuilderInternal instantiates a new ExtensionRequestBuilder and sets the default values. -func NewExtensionRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionRequestBuilder) { - m := &ExtensionRequestBuilder{ +// NewExtensionItemRequestBuilderInternal instantiates a new ExtensionItemRequestBuilder and sets the default values. +func NewExtensionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionItemRequestBuilder) { + m := &ExtensionItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewExtensionRequestBuilder instantiates a new ExtensionRequestBuilder and sets the default values. -func NewExtensionRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionRequestBuilder) { +// NewExtensionItemRequestBuilder instantiates a new ExtensionItemRequestBuilder and sets the default values. +func NewExtensionItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*ExtensionItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewExtensionRequestBuilderInternal(urlParams, requestAdapter) + return NewExtensionItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreateDeleteRequestInformation(options *ExtensionRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreateDeleteRequestInformation(options *ExtensionItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *ExtensionRequestBuilder) CreateDeleteRequestInformation(options *Extens return requestInfo, nil } // CreateGetRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreateGetRequestInformation(options *ExtensionRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreateGetRequestInformation(options *ExtensionItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *ExtensionRequestBuilder) CreateGetRequestInformation(options *Extension return requestInfo, nil } // CreatePatchRequestInformation the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) CreatePatchRequestInformation(options *ExtensionRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *ExtensionItemRequestBuilder) CreatePatchRequestInformation(options *ExtensionItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *ExtensionRequestBuilder) CreatePatchRequestInformation(options *Extensi return requestInfo, nil } // Delete the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Delete(options *ExtensionRequestBuilderDeleteOptions)(error) { +func (m *ExtensionItemRequestBuilder) Delete(options *ExtensionItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Get(options *ExtensionRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension, error) { +func (m *ExtensionItemRequestBuilder) Get(options *ExtensionItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewExtension() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateExtensionFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extension), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Extensionable), nil } // Patch the collection of open extensions defined for the message. Nullable. -func (m *ExtensionRequestBuilder) Patch(options *ExtensionRequestBuilderPatchOptions)(error) { +func (m *ExtensionItemRequestBuilder) Patch(options *ExtensionItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/message_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/message_item_request_builder.go similarity index 66% rename from msgraph-mail/go/utilities/users/item/messages/item/message_request_builder.go rename to msgraph-mail/go/utilities/users/item/messages/item/message_item_request_builder.go index 412366b67..d13100784 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/message_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/message_item_request_builder.go @@ -2,7 +2,6 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" i10075314d3b96cd3f0f2195562b0027395b41f6069ced9cc8d93624bbc206528 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/messages/item/extensions" i170c26461395ae79c8485bb09f6acf415c54c121851bca73450cfff498f75eb8 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties" @@ -15,8 +14,8 @@ import ( if06dd322de6c7a1abe876d18d2ddc86a4b8bcf49f2fea78dcba12aff7dcb4994 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item" ) -// MessageRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id} -type MessageRequestBuilder struct { +// MessageItemRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id} +type MessageItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -24,8 +23,8 @@ type MessageRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MessageRequestBuilderDeleteOptions options for Delete -type MessageRequestBuilderDeleteOptions struct { +// MessageItemRequestBuilderDeleteOptions options for Delete +type MessageItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -33,26 +32,26 @@ type MessageRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRequestBuilderGetOptions options for Get -type MessageRequestBuilderGetOptions struct { +// MessageItemRequestBuilderGetOptions options for Get +type MessageItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MessageRequestBuilderGetQueryParameters; + Q *MessageItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MessageRequestBuilderGetQueryParameters the messages in a mailbox or folder. Read-only. Nullable. -type MessageRequestBuilderGetQueryParameters struct { +// MessageItemRequestBuilderGetQueryParameters the messages in a mailbox or folder. Read-only. Nullable. +type MessageItemRequestBuilderGetQueryParameters struct { // Select properties to be returned Select []string; } -// MessageRequestBuilderPatchOptions options for Patch -type MessageRequestBuilderPatchOptions struct { +// MessageItemRequestBuilderPatchOptions options for Patch +type MessageItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; // Request headers H map[string]string; // Request options @@ -60,11 +59,11 @@ type MessageRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -func (m *MessageRequestBuilder) Attachments()(*i228962c2a18462bcfbde8557f6668f3fd7d4e68d5c7f3f1f3b675bc816866033.AttachmentsRequestBuilder) { +func (m *MessageItemRequestBuilder) Attachments()(*i228962c2a18462bcfbde8557f6668f3fd7d4e68d5c7f3f1f3b675bc816866033.AttachmentsRequestBuilder) { return i228962c2a18462bcfbde8557f6668f3fd7d4e68d5c7f3f1f3b675bc816866033.NewAttachmentsRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // AttachmentsById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.messages.item.attachments.item collection -func (m *MessageRequestBuilder) AttachmentsById(id string)(*idd4800ce8115a136eb3f42205c28105422c049d9e5b23796f3bdf18e2778f6d6.AttachmentRequestBuilder) { +func (m *MessageItemRequestBuilder) AttachmentsById(id string)(*idd4800ce8115a136eb3f42205c28105422c049d9e5b23796f3bdf18e2778f6d6.AttachmentItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -72,32 +71,32 @@ func (m *MessageRequestBuilder) AttachmentsById(id string)(*idd4800ce8115a136eb3 if id != "" { urlTplParams["attachment_id"] = id } - return idd4800ce8115a136eb3f42205c28105422c049d9e5b23796f3bdf18e2778f6d6.NewAttachmentRequestBuilderInternal(urlTplParams, m.requestAdapter); + return idd4800ce8115a136eb3f42205c28105422c049d9e5b23796f3bdf18e2778f6d6.NewAttachmentItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -// NewMessageRequestBuilderInternal instantiates a new MessageRequestBuilder and sets the default values. -func NewMessageRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRequestBuilder) { - m := &MessageRequestBuilder{ +// NewMessageItemRequestBuilderInternal instantiates a new MessageItemRequestBuilder and sets the default values. +func NewMessageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageItemRequestBuilder) { + m := &MessageItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}{?select}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMessageRequestBuilder instantiates a new MessageRequestBuilder and sets the default values. -func NewMessageRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageRequestBuilder) { +// NewMessageItemRequestBuilder instantiates a new MessageItemRequestBuilder and sets the default values. +func NewMessageItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MessageItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMessageRequestBuilderInternal(urlParams, requestAdapter) + return NewMessageItemRequestBuilderInternal(urlParams, requestAdapter) } -func (m *MessageRequestBuilder) Content()(*i9550b442511c46b7a974613d5ee3238fb100cef30fff0520a9682fb3d38ad326.ContentRequestBuilder) { +func (m *MessageItemRequestBuilder) Content()(*i9550b442511c46b7a974613d5ee3238fb100cef30fff0520a9682fb3d38ad326.ContentRequestBuilder) { return i9550b442511c46b7a974613d5ee3238fb100cef30fff0520a9682fb3d38ad326.NewContentRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // CreateDeleteRequestInformation the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) CreateDeleteRequestInformation(options *MessageRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreateDeleteRequestInformation(options *MessageItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -114,7 +113,7 @@ func (m *MessageRequestBuilder) CreateDeleteRequestInformation(options *MessageR return requestInfo, nil } // CreateGetRequestInformation the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) CreateGetRequestInformation(options *MessageRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreateGetRequestInformation(options *MessageItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -134,7 +133,7 @@ func (m *MessageRequestBuilder) CreateGetRequestInformation(options *MessageRequ return requestInfo, nil } // CreatePatchRequestInformation the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) CreatePatchRequestInformation(options *MessageRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MessageItemRequestBuilder) CreatePatchRequestInformation(options *MessageItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -152,22 +151,22 @@ func (m *MessageRequestBuilder) CreatePatchRequestInformation(options *MessageRe return requestInfo, nil } // Delete the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) Delete(options *MessageRequestBuilderDeleteOptions)(error) { +func (m *MessageItemRequestBuilder) Delete(options *MessageItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } -func (m *MessageRequestBuilder) Extensions()(*i10075314d3b96cd3f0f2195562b0027395b41f6069ced9cc8d93624bbc206528.ExtensionsRequestBuilder) { +func (m *MessageItemRequestBuilder) Extensions()(*i10075314d3b96cd3f0f2195562b0027395b41f6069ced9cc8d93624bbc206528.ExtensionsRequestBuilder) { return i10075314d3b96cd3f0f2195562b0027395b41f6069ced9cc8d93624bbc206528.NewExtensionsRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // ExtensionsById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.messages.item.extensions.item collection -func (m *MessageRequestBuilder) ExtensionsById(id string)(*i361d73846d6331cbbe8151dfaef3455f34e63dfa07626b67576681683b148587.ExtensionRequestBuilder) { +func (m *MessageItemRequestBuilder) ExtensionsById(id string)(*i361d73846d6331cbbe8151dfaef3455f34e63dfa07626b67576681683b148587.ExtensionItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -175,25 +174,25 @@ func (m *MessageRequestBuilder) ExtensionsById(id string)(*i361d73846d6331cbbe81 if id != "" { urlTplParams["extension_id"] = id } - return i361d73846d6331cbbe8151dfaef3455f34e63dfa07626b67576681683b148587.NewExtensionRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i361d73846d6331cbbe8151dfaef3455f34e63dfa07626b67576681683b148587.NewExtensionItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Get the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) Get(options *MessageRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, error) { +func (m *MessageItemRequestBuilder) Get(options *MessageItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable), nil } -func (m *MessageRequestBuilder) MultiValueExtendedProperties()(*iadaad8f92ba85254c1d639d8a8cb86def5e843af4bc1062bc836f08d062196d6.MultiValueExtendedPropertiesRequestBuilder) { +func (m *MessageItemRequestBuilder) MultiValueExtendedProperties()(*iadaad8f92ba85254c1d639d8a8cb86def5e843af4bc1062bc836f08d062196d6.MultiValueExtendedPropertiesRequestBuilder) { return iadaad8f92ba85254c1d639d8a8cb86def5e843af4bc1062bc836f08d062196d6.NewMultiValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MultiValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.messages.item.multiValueExtendedProperties.item collection -func (m *MessageRequestBuilder) MultiValueExtendedPropertiesById(id string)(*if06dd322de6c7a1abe876d18d2ddc86a4b8bcf49f2fea78dcba12aff7dcb4994.MultiValueLegacyExtendedPropertyRequestBuilder) { +func (m *MessageItemRequestBuilder) MultiValueExtendedPropertiesById(id string)(*if06dd322de6c7a1abe876d18d2ddc86a4b8bcf49f2fea78dcba12aff7dcb4994.MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -201,25 +200,25 @@ func (m *MessageRequestBuilder) MultiValueExtendedPropertiesById(id string)(*if0 if id != "" { urlTplParams["multiValueLegacyExtendedProperty_id"] = id } - return if06dd322de6c7a1abe876d18d2ddc86a4b8bcf49f2fea78dcba12aff7dcb4994.NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return if06dd322de6c7a1abe876d18d2ddc86a4b8bcf49f2fea78dcba12aff7dcb4994.NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } // Patch the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessageRequestBuilder) Patch(options *MessageRequestBuilderPatchOptions)(error) { +func (m *MessageItemRequestBuilder) Patch(options *MessageItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } -func (m *MessageRequestBuilder) SingleValueExtendedProperties()(*i170c26461395ae79c8485bb09f6acf415c54c121851bca73450cfff498f75eb8.SingleValueExtendedPropertiesRequestBuilder) { +func (m *MessageItemRequestBuilder) SingleValueExtendedProperties()(*i170c26461395ae79c8485bb09f6acf415c54c121851bca73450cfff498f75eb8.SingleValueExtendedPropertiesRequestBuilder) { return i170c26461395ae79c8485bb09f6acf415c54c121851bca73450cfff498f75eb8.NewSingleValueExtendedPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // SingleValueExtendedPropertiesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.messages.item.singleValueExtendedProperties.item collection -func (m *MessageRequestBuilder) SingleValueExtendedPropertiesById(id string)(*i9f73052b0f535426cd146e9403e4e088995d624a331ea8cf19005e2c6ff46d7f.SingleValueLegacyExtendedPropertyRequestBuilder) { +func (m *MessageItemRequestBuilder) SingleValueExtendedPropertiesById(id string)(*i9f73052b0f535426cd146e9403e4e088995d624a331ea8cf19005e2c6ff46d7f.SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -227,5 +226,5 @@ func (m *MessageRequestBuilder) SingleValueExtendedPropertiesById(id string)(*i9 if id != "" { urlTplParams["singleValueLegacyExtendedProperty_id"] = id } - return i9f73052b0f535426cd146e9403e4e088995d624a331ea8cf19005e2c6ff46d7f.NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlTplParams, m.requestAdapter); + return i9f73052b0f535426cd146e9403e4e088995d624a331ea8cf19005e2c6ff46d7f.NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go similarity index 57% rename from msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go index b0e2cd1d9..becb0315a 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/item/multi_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// MultiValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} -type MultiValueLegacyExtendedPropertyRequestBuilder struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\multiValueExtendedProperties\{multiValueLegacyExtendedProperty-id} +type MultiValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type MultiValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type MultiValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the message. Nullable. -type MultiValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of multi-value extended properties defined for the message. Nullable. +type MultiValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewMultiValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { - m := &MultiValueLegacyExtendedPropertyRequestBuilder{ +// NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { + m := &MultiValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewMultiValueLegacyExtendedPropertyRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewMultiValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyRequestBuilder) { +// NewMultiValueLegacyExtendedPropertyItemRequestBuilder instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewMultiValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*MultiValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewMultiValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewMultiValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInfo return requestInfo, nil } // CreateGetRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInforma return requestInfo, nil } // CreatePatchRequestInformation the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *MultiValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfor return requestInfo, nil } // Delete the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *MultiValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Get(options *MultiValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } // Patch the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueLegacyExtendedPropertyRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *MultiValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *MultiValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go index a0d7df4e6..547404e5e 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package multivalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type MultiValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // MultiValueExtendedPropertiesRequestBuilderPostOptions options for Post type MultiValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewMultiValueExtendedPropertiesRequestBuilderInternal(pathParameters map[st for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *MultiValueExtendedPropertiesRequestBuilder) CreatePostRequestInformatio return requestInfo, nil } // Get the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(*MultiValueExtendedPropertiesResponse, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Get(options *MultiValueExtendedPropertiesRequestBuilderGetOptions)(MultiValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMultiValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MultiValueExtendedPropertiesResponse), nil + return res.(MultiValueExtendedPropertiesResponseable), nil } // Post the collection of multi-value extended properties defined for the message. Nullable. -func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, error) { +func (m *MultiValueExtendedPropertiesRequestBuilder) Post(options *MultiValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go index 7ff4d88dc..fe45511e9 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_response.go @@ -12,7 +12,7 @@ type MultiValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable; } // NewMultiValueExtendedPropertiesResponse instantiates a new multiValueExtendedPropertiesResponse and sets the default values. func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewMultiValueExtendedPropertiesResponse()(*MultiValueExtendedPropertiesResp m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMultiValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MultiValueExtendedPropertiesResponse) GetAdditionalData()(map[string]in return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMultiValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MultiValueExtendedPropertiesResponse) GetFieldDeserializers()(map[strin } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MultiValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MultiValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MultiValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MultiValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafad if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MultiValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedProperty)() { +func (m *MultiValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go new file mode 100644 index 000000000..c6080a991 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/messages/item/multivalueextendedproperties/multi_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package multivalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MultiValueExtendedPropertiesResponseable +type MultiValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.MultiValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go similarity index 57% rename from msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go rename to msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go index 5fb45246e..78f0e648e 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/item/single_value_legacy_extended_property_item_request_builder.go @@ -2,12 +2,11 @@ package item import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) -// SingleValueLegacyExtendedPropertyRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} -type SingleValueLegacyExtendedPropertyRequestBuilder struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilder builds and executes requests for operations under \users\{user-id}\messages\{message-id}\singleValueExtendedProperties\{singleValueLegacyExtendedProperty-id} +type SingleValueLegacyExtendedPropertyItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -15,8 +14,8 @@ type SingleValueLegacyExtendedPropertyRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions options for Delete -type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions options for Delete +type SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions struct { // Request headers H map[string]string; // Request options @@ -24,28 +23,28 @@ type SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetOptions options for Get -type SingleValueLegacyExtendedPropertyRequestBuilderGetOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions options for Get +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions struct { // Request headers H map[string]string; // Request options O []ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestOption; // Request query parameters - Q *SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters; + Q *SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters; // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the message. Nullable. -type SingleValueLegacyExtendedPropertyRequestBuilderGetQueryParameters struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters the collection of single-value extended properties defined for the message. Nullable. +type SingleValueLegacyExtendedPropertyItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string; // Select properties to be returned Select []string; } -// SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions options for Patch -type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { +// SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions options for Patch +type SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -53,27 +52,27 @@ type SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions struct { // Response handler to use in place of the default response handling provided by the core service ResponseHandler ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.ResponseHandler; } -// NewSingleValueLegacyExtendedPropertyRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { - m := &SingleValueLegacyExtendedPropertyRequestBuilder{ +// NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { + m := &SingleValueLegacyExtendedPropertyItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewSingleValueLegacyExtendedPropertyRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. -func NewSingleValueLegacyExtendedPropertyRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyRequestBuilder) { +// NewSingleValueLegacyExtendedPropertyItemRequestBuilder instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. +func NewSingleValueLegacyExtendedPropertyItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*SingleValueLegacyExtendedPropertyItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewSingleValueLegacyExtendedPropertyRequestBuilderInternal(urlParams, requestAdapter) + return NewSingleValueLegacyExtendedPropertyItemRequestBuilderInternal(urlParams, requestAdapter) } // CreateDeleteRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateDeleteRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -90,7 +89,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateDeleteRequestInf return requestInfo, nil } // CreateGetRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreateGetRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -110,7 +109,7 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreateGetRequestInform return requestInfo, nil } // CreatePatchRequestInformation the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) CreatePatchRequestInformation(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(*ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestInformation, error) { requestInfo := ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.NewRequestInformation() requestInfo.UrlTemplate = m.urlTemplate requestInfo.PathParameters = m.pathParameters @@ -128,36 +127,36 @@ func (m *SingleValueLegacyExtendedPropertyRequestBuilder) CreatePatchRequestInfo return requestInfo, nil } // Delete the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyRequestBuilderDeleteOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Delete(options *SingleValueLegacyExtendedPropertyItemRequestBuilderDeleteOptions)(error) { requestInfo, err := m.CreateDeleteRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } return nil } // Get the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyRequestBuilderGetOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Get(options *SingleValueLegacyExtendedPropertyItemRequestBuilderGetOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } // Patch the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueLegacyExtendedPropertyRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyRequestBuilderPatchOptions)(error) { +func (m *SingleValueLegacyExtendedPropertyItemRequestBuilder) Patch(options *SingleValueLegacyExtendedPropertyItemRequestBuilderPatchOptions)(error) { requestInfo, err := m.CreatePatchRequestInformation(options); if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go index 88bce0c90..cf4233c1b 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_request_builder.go @@ -2,7 +2,6 @@ package singlevalueextendedproperties import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -48,7 +47,7 @@ type SingleValueExtendedPropertiesRequestBuilderGetQueryParameters struct { // SingleValueExtendedPropertiesRequestBuilderPostOptions options for Post type SingleValueExtendedPropertiesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; // Request headers H map[string]string; // Request options @@ -65,7 +64,7 @@ func NewSingleValueExtendedPropertiesRequestBuilderInternal(pathParameters map[s for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -114,26 +113,26 @@ func (m *SingleValueExtendedPropertiesRequestBuilder) CreatePostRequestInformati return requestInfo, nil } // Get the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(*SingleValueExtendedPropertiesResponse, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Get(options *SingleValueExtendedPropertiesRequestBuilderGetOptions)(SingleValueExtendedPropertiesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewSingleValueExtendedPropertiesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*SingleValueExtendedPropertiesResponse), nil + return res.(SingleValueExtendedPropertiesResponseable), nil } // Post the collection of single-value extended properties defined for the message. Nullable. -func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, error) { +func (m *SingleValueExtendedPropertiesRequestBuilder) Post(options *SingleValueExtendedPropertiesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable), nil } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go index f69ef5fdc..1a730d6ae 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_response.go @@ -12,7 +12,7 @@ type SingleValueExtendedPropertiesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable; } // NewSingleValueExtendedPropertiesResponse instantiates a new singleValueExtendedPropertiesResponse and sets the default values. func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesResponse) { @@ -21,6 +21,10 @@ func NewSingleValueExtendedPropertiesResponse()(*SingleValueExtendedPropertiesRe m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewSingleValueExtendedPropertiesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *SingleValueExtendedPropertiesResponse) GetAdditionalData()(map[string]i return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewSingleValueLegacyExtendedProperty() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *SingleValueExtendedPropertiesResponse) GetFieldDeserializers()(map[stri } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *SingleValueExtendedPropertiesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *SingleValueExtendedPropertiesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *SingleValueExtendedPropertiesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *SingleValueExtendedPropertiesResponse) Serialize(writer i04eb5309aeaafa if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *SingleValueExtendedPropertiesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedProperty)() { +func (m *SingleValueExtendedPropertiesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go new file mode 100644 index 000000000..aea4fd899 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/messages/item/singlevalueextendedproperties/single_value_extended_properties_responseable.go @@ -0,0 +1,15 @@ +package singlevalueextendedproperties + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// SingleValueExtendedPropertiesResponseable +type SingleValueExtendedPropertiesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.SingleValueLegacyExtendedPropertyable)() +} diff --git a/msgraph-mail/go/utilities/users/item/messages/item/value/content_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/item/value/content_request_builder.go index f3c474c8c..b74a9b241 100644 --- a/msgraph-mail/go/utilities/users/item/messages/item/value/content_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/item/value/content_request_builder.go @@ -42,7 +42,7 @@ func NewContentRequestBuilderInternal(pathParameters map[string]string, requestA for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -93,7 +93,7 @@ func (m *ContentRequestBuilder) Get(options *ContentRequestBuilderGetOptions)([] if err != nil { return nil, err } - res, err := m.requestAdapter.SendPrimitiveAsync(*requestInfo, "byte", nil) + res, err := m.requestAdapter.SendPrimitiveAsync(*requestInfo, "byte", nil, nil) if err != nil { return nil, err } @@ -105,7 +105,7 @@ func (m *ContentRequestBuilder) Put(options *ContentRequestBuilderPutOptions)(er if err != nil { return err } - err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil) + err = m.requestAdapter.SendNoContentAsync(*requestInfo, nil, nil) if err != nil { return err } diff --git a/msgraph-mail/go/utilities/users/item/messages/messages_request_builder.go b/msgraph-mail/go/utilities/users/item/messages/messages_request_builder.go index 04b84567a..3088cfc91 100644 --- a/msgraph-mail/go/utilities/users/item/messages/messages_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/messages/messages_request_builder.go @@ -2,7 +2,6 @@ package messages import ( ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go" - i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" ) @@ -46,7 +45,7 @@ type MessagesRequestBuilderGetQueryParameters struct { // MessagesRequestBuilderPostOptions options for Post type MessagesRequestBuilderPostOptions struct { // - Body *i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + Body i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; // Request headers H map[string]string; // Request options @@ -63,7 +62,7 @@ func NewMessagesRequestBuilderInternal(pathParameters map[string]string, request for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } @@ -112,26 +111,26 @@ func (m *MessagesRequestBuilder) CreatePostRequestInformation(options *MessagesR return requestInfo, nil } // Get the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessagesRequestBuilder) Get(options *MessagesRequestBuilderGetOptions)(*MessagesResponse, error) { +func (m *MessagesRequestBuilder) Get(options *MessagesRequestBuilderGetOptions)(MessagesResponseable, error) { requestInfo, err := m.CreateGetRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return NewMessagesResponse() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, CreateMessagesResponseFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*MessagesResponse), nil + return res.(MessagesResponseable), nil } // Post the messages in a mailbox or folder. Read-only. Nullable. -func (m *MessagesRequestBuilder) Post(options *MessagesRequestBuilderPostOptions)(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, error) { +func (m *MessagesRequestBuilder) Post(options *MessagesRequestBuilderPostOptions)(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, error) { requestInfo, err := m.CreatePostRequestInformation(options); if err != nil { return nil, err } - res, err := m.requestAdapter.SendAsync(*requestInfo, func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }, nil) + res, err := m.requestAdapter.SendAsync(*requestInfo, i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue, nil, nil) if err != nil { return nil, err } - return res.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message), nil + return res.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable), nil } diff --git a/msgraph-mail/go/utilities/users/item/messages/messages_response.go b/msgraph-mail/go/utilities/users/item/messages/messages_response.go index e77c40f89..2da751bfd 100644 --- a/msgraph-mail/go/utilities/users/item/messages/messages_response.go +++ b/msgraph-mail/go/utilities/users/item/messages/messages_response.go @@ -12,7 +12,7 @@ type MessagesResponse struct { // nextLink *string; // - value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message; + value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable; } // NewMessagesResponse instantiates a new messagesResponse and sets the default values. func NewMessagesResponse()(*MessagesResponse) { @@ -21,6 +21,10 @@ func NewMessagesResponse()(*MessagesResponse) { m.SetAdditionalData(make(map[string]interface{})); return m } +// CreateMessagesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMessagesResponseFromDiscriminatorValue(parseNode i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, error) { + return NewMessagesResponse(), nil +} // GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *MessagesResponse) GetAdditionalData()(map[string]interface{}) { if m == nil { @@ -29,22 +33,6 @@ func (m *MessagesResponse) GetAdditionalData()(map[string]interface{}) { return m.additionalData } } -// GetNextLink gets the @odata.nextLink property value. -func (m *MessagesResponse) GetNextLink()(*string) { - if m == nil { - return nil - } else { - return m.nextLink - } -} -// GetValue gets the value property value. -func (m *MessagesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message) { - if m == nil { - return nil - } else { - return m.value - } -} // GetFieldDeserializers the deserialization information for the current model func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) { res := make(map[string]func(interface{}, i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode)(error)) @@ -59,14 +47,14 @@ func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, return nil } res["value"] = func (o interface{}, n i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(func () i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable { return i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.NewMessage() }) + val, err := n.GetCollectionOfObjectValues(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.CreateMessageFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message, len(val)) + res := make([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable, len(val)) for i, v := range val { - res[i] = *(v.(*i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message)) + res[i] = v.(i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) } m.SetValue(res) } @@ -74,6 +62,22 @@ func (m *MessagesResponse) GetFieldDeserializers()(map[string]func(interface{}, } return res } +// GetNextLink gets the @odata.nextLink property value. +func (m *MessagesResponse) GetNextLink()(*string) { + if m == nil { + return nil + } else { + return m.nextLink + } +} +// GetValue gets the value property value. +func (m *MessagesResponse) GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) { + if m == nil { + return nil + } else { + return m.value + } +} func (m *MessagesResponse) IsNil()(bool) { return m == nil } @@ -88,8 +92,7 @@ func (m *MessagesResponse) Serialize(writer i04eb5309aeaafadd28374d79c8471df9b26 if m.GetValue() != nil { cast := make([]i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable, len(m.GetValue())) for i, v := range m.GetValue() { - temp := v - cast[i] = i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable(&temp) + cast[i] = v.(i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable) } err := writer.WriteCollectionOfObjectValues("value", cast) if err != nil { @@ -117,7 +120,7 @@ func (m *MessagesResponse) SetNextLink(value *string)() { } } // SetValue sets the value property value. -func (m *MessagesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Message)() { +func (m *MessagesResponse) SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable)() { if m != nil { m.value = value } diff --git a/msgraph-mail/go/utilities/users/item/messages/messages_responseable.go b/msgraph-mail/go/utilities/users/item/messages/messages_responseable.go new file mode 100644 index 000000000..2fdc56522 --- /dev/null +++ b/msgraph-mail/go/utilities/users/item/messages/messages_responseable.go @@ -0,0 +1,15 @@ +package messages + +import ( + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization" + i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/models/microsoft/graph" +) + +// MessagesResponseable +type MessagesResponseable interface { + i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55.Parsable + GetNextLink()(*string) + GetValue()([]i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable) + SetNextLink(value *string)() + SetValue(value []i2bf413bd639f9258700927995a2deeba4c8f0c1344d988e5d8e5959b0bb6f4ce.Messageable)() +} diff --git a/msgraph-mail/go/utilities/users/item/user_request_builder.go b/msgraph-mail/go/utilities/users/item/user_item_request_builder.go similarity index 62% rename from msgraph-mail/go/utilities/users/item/user_request_builder.go rename to msgraph-mail/go/utilities/users/item/user_item_request_builder.go index 3e6703414..e389be968 100644 --- a/msgraph-mail/go/utilities/users/item/user_request_builder.go +++ b/msgraph-mail/go/utilities/users/item/user_item_request_builder.go @@ -9,8 +9,8 @@ import ( if937953a6e06f9e461297be544e9a26dbe87704845fad3ae4b78b2ca32d53222 "github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/users/item/mailfolders/item" ) -// UserRequestBuilder builds and executes requests for operations under \users\{user-id} -type UserRequestBuilder struct { +// UserItemRequestBuilder builds and executes requests for operations under \users\{user-id} +type UserItemRequestBuilder struct { // Path parameters for the request pathParameters map[string]string; // The request adapter to use to execute the requests. @@ -18,33 +18,33 @@ type UserRequestBuilder struct { // Url template to use to build the URL for the current request builder urlTemplate string; } -// NewUserRequestBuilderInternal instantiates a new UserRequestBuilder and sets the default values. -func NewUserRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*UserRequestBuilder) { - m := &UserRequestBuilder{ +// NewUserItemRequestBuilderInternal instantiates a new UserItemRequestBuilder and sets the default values. +func NewUserItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*UserItemRequestBuilder) { + m := &UserItemRequestBuilder{ } m.urlTemplate = "{+baseurl}/users/{user_id}"; urlTplParams := make(map[string]string) for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } -// NewUserRequestBuilder instantiates a new UserRequestBuilder and sets the default values. -func NewUserRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*UserRequestBuilder) { +// NewUserItemRequestBuilder instantiates a new UserItemRequestBuilder and sets the default values. +func NewUserItemRequestBuilder(rawUrl string, requestAdapter ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9.RequestAdapter)(*UserItemRequestBuilder) { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewUserRequestBuilderInternal(urlParams, requestAdapter) + return NewUserItemRequestBuilderInternal(urlParams, requestAdapter) } -func (m *UserRequestBuilder) InferenceClassification()(*i9bcbbe222fda57b1c7f212f812b862b760156d2d3a9d1e157ee4f76841199559.InferenceClassificationRequestBuilder) { +func (m *UserItemRequestBuilder) InferenceClassification()(*i9bcbbe222fda57b1c7f212f812b862b760156d2d3a9d1e157ee4f76841199559.InferenceClassificationRequestBuilder) { return i9bcbbe222fda57b1c7f212f812b862b760156d2d3a9d1e157ee4f76841199559.NewInferenceClassificationRequestBuilderInternal(m.pathParameters, m.requestAdapter); } -func (m *UserRequestBuilder) MailFolders()(*ib8edbc02a502b08756d43d6d66bfafac60ac37ce024db3b7e881dc17cea846a8.MailFoldersRequestBuilder) { +func (m *UserItemRequestBuilder) MailFolders()(*ib8edbc02a502b08756d43d6d66bfafac60ac37ce024db3b7e881dc17cea846a8.MailFoldersRequestBuilder) { return ib8edbc02a502b08756d43d6d66bfafac60ac37ce024db3b7e881dc17cea846a8.NewMailFoldersRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MailFoldersById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.mailFolders.item collection -func (m *UserRequestBuilder) MailFoldersById(id string)(*if937953a6e06f9e461297be544e9a26dbe87704845fad3ae4b78b2ca32d53222.MailFolderRequestBuilder) { +func (m *UserItemRequestBuilder) MailFoldersById(id string)(*if937953a6e06f9e461297be544e9a26dbe87704845fad3ae4b78b2ca32d53222.MailFolderItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -52,13 +52,13 @@ func (m *UserRequestBuilder) MailFoldersById(id string)(*if937953a6e06f9e461297b if id != "" { urlTplParams["mailFolder_id"] = id } - return if937953a6e06f9e461297be544e9a26dbe87704845fad3ae4b78b2ca32d53222.NewMailFolderRequestBuilderInternal(urlTplParams, m.requestAdapter); + return if937953a6e06f9e461297be544e9a26dbe87704845fad3ae4b78b2ca32d53222.NewMailFolderItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } -func (m *UserRequestBuilder) Messages()(*i341158d6b31e193c6856ef08d3a5c0a9d9c9674cd883d99b10844de8d933df7a.MessagesRequestBuilder) { +func (m *UserItemRequestBuilder) Messages()(*i341158d6b31e193c6856ef08d3a5c0a9d9c9674cd883d99b10844de8d933df7a.MessagesRequestBuilder) { return i341158d6b31e193c6856ef08d3a5c0a9d9c9674cd883d99b10844de8d933df7a.NewMessagesRequestBuilderInternal(m.pathParameters, m.requestAdapter); } // MessagesById gets an item from the github.com/microsoft/kiota-samples/msgraph-mail/go/utilities/.users.item.messages.item collection -func (m *UserRequestBuilder) MessagesById(id string)(*ia31bb5deda23f2b146eb943e6d6e68f69c1487606651126c6dbde9f9b4b6ae99.MessageRequestBuilder) { +func (m *UserItemRequestBuilder) MessagesById(id string)(*ia31bb5deda23f2b146eb943e6d6e68f69c1487606651126c6dbde9f9b4b6ae99.MessageItemRequestBuilder) { urlTplParams := make(map[string]string) for idx, item := range m.pathParameters { urlTplParams[idx] = item @@ -66,5 +66,5 @@ func (m *UserRequestBuilder) MessagesById(id string)(*ia31bb5deda23f2b146eb943e6 if id != "" { urlTplParams["message_id"] = id } - return ia31bb5deda23f2b146eb943e6d6e68f69c1487606651126c6dbde9f9b4b6ae99.NewMessageRequestBuilderInternal(urlTplParams, m.requestAdapter); + return ia31bb5deda23f2b146eb943e6d6e68f69c1487606651126c6dbde9f9b4b6ae99.NewMessageItemRequestBuilderInternal(urlTplParams, m.requestAdapter); } diff --git a/msgraph-mail/go/utilities/users/users_request_builder.go b/msgraph-mail/go/utilities/users/users_request_builder.go index 7b46774d0..aa1703040 100644 --- a/msgraph-mail/go/utilities/users/users_request_builder.go +++ b/msgraph-mail/go/utilities/users/users_request_builder.go @@ -22,7 +22,7 @@ func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAda for idx, item := range pathParameters { urlTplParams[idx] = item } - m.pathParameters = pathParameters; + m.pathParameters = urlTplParams; m.requestAdapter = requestAdapter; return m } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/ApiClient.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/ApiClient.java index 6d68e84b6..a7e8ee75d 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/ApiClient.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/ApiClient.java @@ -6,7 +6,7 @@ import com.microsoft.kiota.serialization.JsonSerializationWriterFactory; import com.microsoft.kiota.serialization.ParseNodeFactoryRegistry; import com.microsoft.kiota.serialization.SerializationWriterFactoryRegistry; -import graphjavav4.utilities.users.item.UserRequestBuilder; +import graphjavav4.utilities.users.item.UserItemRequestBuilder; import graphjavav4.utilities.users.UsersRequestBuilder; import java.util.HashMap; import java.util.Objects; @@ -39,13 +39,13 @@ public ApiClient(@javax.annotation.Nonnull final RequestAdapter requestAdapter) /** * Gets an item from the graphjavav4.utilities.users.item collection * @param id Unique identifier of the item - * @return a userRequestBuilder + * @return a userItemRequestBuilder */ @javax.annotation.Nonnull - public UserRequestBuilder users(@javax.annotation.Nonnull final String id) { + public UserItemRequestBuilder users(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("user_id", id); - return new UserRequestBuilder(urlTplParams, requestAdapter); + return new UserItemRequestBuilder(urlTplParams, requestAdapter); } } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Attachment.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Attachment.java index f95ff753c..1999a0f45 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Attachment.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Attachment.java @@ -26,6 +26,16 @@ public class Attachment extends Entity implements Parsable { public Attachment() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a attachment + */ + @javax.annotation.Nonnull + public static Attachment createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new Attachment(); + } /** * Gets the contentType property value. The MIME type. * @return a string @@ -34,6 +44,20 @@ public Attachment() { public String getContentType() { return this._contentType; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(super.getFieldDeserializers()) {{ + this.put("contentType", (o, n) -> { ((Attachment)o).setContentType(n.getStringValue()); }); + this.put("isInline", (o, n) -> { ((Attachment)o).setIsInline(n.getBooleanValue()); }); + this.put("lastModifiedDateTime", (o, n) -> { ((Attachment)o).setLastModifiedDateTime(n.getOffsetDateTimeValue()); }); + this.put("name", (o, n) -> { ((Attachment)o).setName(n.getStringValue()); }); + this.put("size", (o, n) -> { ((Attachment)o).setSize(n.getIntegerValue()); }); + }}; + } /** * Gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. * @return a boolean @@ -66,20 +90,6 @@ public String getName() { public Integer getSize() { return this._size; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(super.getFieldDeserializers()) {{ - this.put("contentType", (o, n) -> { ((Attachment)o).setContentType(n.getStringValue()); }); - this.put("isInline", (o, n) -> { ((Attachment)o).setIsInline(n.getBooleanValue()); }); - this.put("lastModifiedDateTime", (o, n) -> { ((Attachment)o).setLastModifiedDateTime(n.getOffsetDateTimeValue()); }); - this.put("name", (o, n) -> { ((Attachment)o).setName(n.getStringValue()); }); - this.put("size", (o, n) -> { ((Attachment)o).setSize(n.getIntegerValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/DateTimeTimeZone.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/DateTimeTimeZone.java index c2b407861..307c58434 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/DateTimeTimeZone.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/DateTimeTimeZone.java @@ -21,6 +21,16 @@ public class DateTimeTimeZone implements Parsable { public DateTimeTimeZone() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a dateTimeTimeZone + */ + @javax.annotation.Nonnull + public static DateTimeTimeZone createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new DateTimeTimeZone(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -37,14 +47,6 @@ public Map getAdditionalData() { public String getDateTime() { return this._dateTime; } - /** - * Gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. - * @return a string - */ - @javax.annotation.Nullable - public String getTimeZone() { - return this._timeZone; - } /** * The deserialization information for the current model * @return a Map> @@ -56,6 +58,14 @@ public Map> getFieldDeserializers() { this.put("timeZone", (o, n) -> { ((DateTimeTimeZone)o).setTimeZone(n.getStringValue()); }); }}; } + /** + * Gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. + * @return a string + */ + @javax.annotation.Nullable + public String getTimeZone() { + return this._timeZone; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/EmailAddress.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/EmailAddress.java index a0d48dd3c..1edf41934 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/EmailAddress.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/EmailAddress.java @@ -21,6 +21,16 @@ public class EmailAddress implements Parsable { public EmailAddress() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a emailAddress + */ + @javax.annotation.Nonnull + public static EmailAddress createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new EmailAddress(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -37,14 +47,6 @@ public Map getAdditionalData() { public String getAddress() { return this._address; } - /** - * Gets the name property value. The display name of the person or entity. - * @return a string - */ - @javax.annotation.Nullable - public String getName() { - return this._name; - } /** * The deserialization information for the current model * @return a Map> @@ -56,6 +58,14 @@ public Map> getFieldDeserializers() { this.put("name", (o, n) -> { ((EmailAddress)o).setName(n.getStringValue()); }); }}; } + /** + * Gets the name property value. The display name of the person or entity. + * @return a string + */ + @javax.annotation.Nullable + public String getName() { + return this._name; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Entity.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Entity.java index 0bca85bee..2341a8127 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Entity.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Entity.java @@ -19,6 +19,16 @@ public class Entity implements Parsable { public Entity() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a entity + */ + @javax.annotation.Nonnull + public static Entity createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new Entity(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -27,14 +37,6 @@ public Entity() { public Map getAdditionalData() { return this._additionalData; } - /** - * Gets the id property value. Read-only. - * @return a string - */ - @javax.annotation.Nullable - public String getId() { - return this._id; - } /** * The deserialization information for the current model * @return a Map> @@ -45,6 +47,14 @@ public Map> getFieldDeserializers() { this.put("id", (o, n) -> { ((Entity)o).setId(n.getStringValue()); }); }}; } + /** + * Gets the id property value. Read-only. + * @return a string + */ + @javax.annotation.Nullable + public String getId() { + return this._id; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Extension.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Extension.java index f519930c8..d2ee15a17 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Extension.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Extension.java @@ -15,6 +15,16 @@ public class Extension extends Entity implements Parsable { public Extension() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a extension + */ + @javax.annotation.Nonnull + public static Extension createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new Extension(); + } /** * The deserialization information for the current model * @return a Map> diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/FollowupFlag.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/FollowupFlag.java index 8ecd839b3..331f38816 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/FollowupFlag.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/FollowupFlag.java @@ -21,6 +21,16 @@ public class FollowupFlag implements Parsable { public FollowupFlag() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a followupFlag + */ + @javax.annotation.Nonnull + public static FollowupFlag createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new FollowupFlag(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -45,6 +55,19 @@ public DateTimeTimeZone getCompletedDateTime() { public DateTimeTimeZone getDueDateTime() { return this._dueDateTime; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(4) {{ + this.put("completedDateTime", (o, n) -> { ((FollowupFlag)o).setCompletedDateTime(n.getObjectValue(DateTimeTimeZone::createFromDiscriminatorValue)); }); + this.put("dueDateTime", (o, n) -> { ((FollowupFlag)o).setDueDateTime(n.getObjectValue(DateTimeTimeZone::createFromDiscriminatorValue)); }); + this.put("flagStatus", (o, n) -> { ((FollowupFlag)o).setFlagStatus(n.getEnumValue(FollowupFlagStatus.class)); }); + this.put("startDateTime", (o, n) -> { ((FollowupFlag)o).setStartDateTime(n.getObjectValue(DateTimeTimeZone::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the flagStatus property value. * @return a followupFlagStatus @@ -61,19 +84,6 @@ public FollowupFlagStatus getFlagStatus() { public DateTimeTimeZone getStartDateTime() { return this._startDateTime; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(4) {{ - this.put("completedDateTime", (o, n) -> { ((FollowupFlag)o).setCompletedDateTime(n.getObjectValue(DateTimeTimeZone.class)); }); - this.put("dueDateTime", (o, n) -> { ((FollowupFlag)o).setDueDateTime(n.getObjectValue(DateTimeTimeZone.class)); }); - this.put("flagStatus", (o, n) -> { ((FollowupFlag)o).setFlagStatus(n.getEnumValue(FollowupFlagStatus.class)); }); - this.put("startDateTime", (o, n) -> { ((FollowupFlag)o).setStartDateTime(n.getObjectValue(DateTimeTimeZone.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassification.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassification.java index 2da6714c1..ab3dc2f17 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassification.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassification.java @@ -18,12 +18,14 @@ public InferenceClassification() { super(); } /** - * Gets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. - * @return a inferenceClassificationOverride + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a inferenceClassification */ - @javax.annotation.Nullable - public java.util.List getOverrides() { - return this._overrides; + @javax.annotation.Nonnull + public static InferenceClassification createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new InferenceClassification(); } /** * The deserialization information for the current model @@ -32,9 +34,17 @@ public java.util.List getOverrides() { @javax.annotation.Nonnull public Map> getFieldDeserializers() { return new HashMap<>(super.getFieldDeserializers()) {{ - this.put("overrides", (o, n) -> { ((InferenceClassification)o).setOverrides(n.getCollectionOfObjectValues(InferenceClassificationOverride.class)); }); + this.put("overrides", (o, n) -> { ((InferenceClassification)o).setOverrides(n.getCollectionOfObjectValues(InferenceClassificationOverride::createFromDiscriminatorValue)); }); }}; } + /** + * Gets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. + * @return a inferenceClassificationOverride + */ + @javax.annotation.Nullable + public java.util.List getOverrides() { + return this._overrides; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassificationOverride.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassificationOverride.java index ae994ffe2..25b72ccd7 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassificationOverride.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InferenceClassificationOverride.java @@ -17,6 +17,16 @@ public class InferenceClassificationOverride extends Entity implements Parsable public InferenceClassificationOverride() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a inferenceClassificationOverride + */ + @javax.annotation.Nonnull + public static InferenceClassificationOverride createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new InferenceClassificationOverride(); + } /** * Gets the classifyAs property value. * @return a inferenceClassificationType @@ -25,14 +35,6 @@ public InferenceClassificationOverride() { public InferenceClassificationType getClassifyAs() { return this._classifyAs; } - /** - * Gets the senderEmailAddress property value. - * @return a emailAddress - */ - @javax.annotation.Nullable - public EmailAddress getSenderEmailAddress() { - return this._senderEmailAddress; - } /** * The deserialization information for the current model * @return a Map> @@ -41,9 +43,17 @@ public EmailAddress getSenderEmailAddress() { public Map> getFieldDeserializers() { return new HashMap<>(super.getFieldDeserializers()) {{ this.put("classifyAs", (o, n) -> { ((InferenceClassificationOverride)o).setClassifyAs(n.getEnumValue(InferenceClassificationType.class)); }); - this.put("senderEmailAddress", (o, n) -> { ((InferenceClassificationOverride)o).setSenderEmailAddress(n.getObjectValue(EmailAddress.class)); }); + this.put("senderEmailAddress", (o, n) -> { ((InferenceClassificationOverride)o).setSenderEmailAddress(n.getObjectValue(EmailAddress::createFromDiscriminatorValue)); }); }}; } + /** + * Gets the senderEmailAddress property value. + * @return a emailAddress + */ + @javax.annotation.Nullable + public EmailAddress getSenderEmailAddress() { + return this._senderEmailAddress; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InternetMessageHeader.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InternetMessageHeader.java index 626cdc623..53a1616c2 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InternetMessageHeader.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/InternetMessageHeader.java @@ -21,6 +21,16 @@ public class InternetMessageHeader implements Parsable { public InternetMessageHeader() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a internetMessageHeader + */ + @javax.annotation.Nonnull + public static InternetMessageHeader createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new InternetMessageHeader(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -29,6 +39,17 @@ public InternetMessageHeader() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("name", (o, n) -> { ((InternetMessageHeader)o).setName(n.getStringValue()); }); + this.put("value", (o, n) -> { ((InternetMessageHeader)o).setValue(n.getStringValue()); }); + }}; + } /** * Gets the name property value. Represents the key in a key-value pair. * @return a string @@ -45,17 +66,6 @@ public String getName() { public String getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("name", (o, n) -> { ((InternetMessageHeader)o).setName(n.getStringValue()); }); - this.put("value", (o, n) -> { ((InternetMessageHeader)o).setValue(n.getStringValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/ItemBody.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/ItemBody.java index 07245c2f3..2e8cbe4f1 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/ItemBody.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/ItemBody.java @@ -20,6 +20,16 @@ public class ItemBody implements Parsable { public ItemBody() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a itemBody + */ + @javax.annotation.Nonnull + public static ItemBody createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new ItemBody(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MailFolder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MailFolder.java index 3ef2a4c78..5524efd41 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MailFolder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MailFolder.java @@ -37,6 +37,16 @@ public class MailFolder extends Entity implements Parsable { public MailFolder() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a mailFolder + */ + @javax.annotation.Nonnull + public static MailFolder createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MailFolder(); + } /** * Gets the childFolderCount property value. The number of immediate child mailFolders in the current mailFolder. * @return a integer @@ -61,6 +71,26 @@ public java.util.List getChildFolders() { public String getDisplayName() { return this._displayName; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(super.getFieldDeserializers()) {{ + this.put("childFolderCount", (o, n) -> { ((MailFolder)o).setChildFolderCount(n.getIntegerValue()); }); + this.put("childFolders", (o, n) -> { ((MailFolder)o).setChildFolders(n.getCollectionOfObjectValues(MailFolder::createFromDiscriminatorValue)); }); + this.put("displayName", (o, n) -> { ((MailFolder)o).setDisplayName(n.getStringValue()); }); + this.put("isHidden", (o, n) -> { ((MailFolder)o).setIsHidden(n.getBooleanValue()); }); + this.put("messageRules", (o, n) -> { ((MailFolder)o).setMessageRules(n.getCollectionOfObjectValues(MessageRule::createFromDiscriminatorValue)); }); + this.put("messages", (o, n) -> { ((MailFolder)o).setMessages(n.getCollectionOfObjectValues(Message::createFromDiscriminatorValue)); }); + this.put("multiValueExtendedProperties", (o, n) -> { ((MailFolder)o).setMultiValueExtendedProperties(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + this.put("parentFolderId", (o, n) -> { ((MailFolder)o).setParentFolderId(n.getStringValue()); }); + this.put("singleValueExtendedProperties", (o, n) -> { ((MailFolder)o).setSingleValueExtendedProperties(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + this.put("totalItemCount", (o, n) -> { ((MailFolder)o).setTotalItemCount(n.getIntegerValue()); }); + this.put("unreadItemCount", (o, n) -> { ((MailFolder)o).setUnreadItemCount(n.getIntegerValue()); }); + }}; + } /** * Gets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. * @return a boolean @@ -125,26 +155,6 @@ public Integer getTotalItemCount() { public Integer getUnreadItemCount() { return this._unreadItemCount; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(super.getFieldDeserializers()) {{ - this.put("childFolderCount", (o, n) -> { ((MailFolder)o).setChildFolderCount(n.getIntegerValue()); }); - this.put("childFolders", (o, n) -> { ((MailFolder)o).setChildFolders(n.getCollectionOfObjectValues(MailFolder.class)); }); - this.put("displayName", (o, n) -> { ((MailFolder)o).setDisplayName(n.getStringValue()); }); - this.put("isHidden", (o, n) -> { ((MailFolder)o).setIsHidden(n.getBooleanValue()); }); - this.put("messageRules", (o, n) -> { ((MailFolder)o).setMessageRules(n.getCollectionOfObjectValues(MessageRule.class)); }); - this.put("messages", (o, n) -> { ((MailFolder)o).setMessages(n.getCollectionOfObjectValues(Message.class)); }); - this.put("multiValueExtendedProperties", (o, n) -> { ((MailFolder)o).setMultiValueExtendedProperties(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty.class)); }); - this.put("parentFolderId", (o, n) -> { ((MailFolder)o).setParentFolderId(n.getStringValue()); }); - this.put("singleValueExtendedProperties", (o, n) -> { ((MailFolder)o).setSingleValueExtendedProperties(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty.class)); }); - this.put("totalItemCount", (o, n) -> { ((MailFolder)o).setTotalItemCount(n.getIntegerValue()); }); - this.put("unreadItemCount", (o, n) -> { ((MailFolder)o).setUnreadItemCount(n.getIntegerValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Message.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Message.java index a495a9f25..5d9c49177 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Message.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Message.java @@ -56,6 +56,16 @@ public class Message extends OutlookItem implements Parsable { public Message() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a message + */ + @javax.annotation.Nonnull + public static Message createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new Message(); + } /** * Gets the attachments property value. The fileAttachment and itemAttachment attachments for the message. * @return a attachment @@ -120,6 +130,45 @@ public byte[] getConversationIndex() { public java.util.List getExtensions() { return this._extensions; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(super.getFieldDeserializers()) {{ + this.put("attachments", (o, n) -> { ((Message)o).setAttachments(n.getCollectionOfObjectValues(Attachment::createFromDiscriminatorValue)); }); + this.put("bccRecipients", (o, n) -> { ((Message)o).setBccRecipients(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("body", (o, n) -> { ((Message)o).setBody(n.getObjectValue(ItemBody::createFromDiscriminatorValue)); }); + this.put("bodyPreview", (o, n) -> { ((Message)o).setBodyPreview(n.getStringValue()); }); + this.put("ccRecipients", (o, n) -> { ((Message)o).setCcRecipients(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("conversationId", (o, n) -> { ((Message)o).setConversationId(n.getStringValue()); }); + this.put("conversationIndex", (o, n) -> { ((Message)o).setConversationIndex(n.getByteArrayValue()); }); + this.put("extensions", (o, n) -> { ((Message)o).setExtensions(n.getCollectionOfObjectValues(Extension::createFromDiscriminatorValue)); }); + this.put("flag", (o, n) -> { ((Message)o).setFlag(n.getObjectValue(FollowupFlag::createFromDiscriminatorValue)); }); + this.put("from", (o, n) -> { ((Message)o).setFrom(n.getObjectValue(Recipient::createFromDiscriminatorValue)); }); + this.put("hasAttachments", (o, n) -> { ((Message)o).setHasAttachments(n.getBooleanValue()); }); + this.put("importance", (o, n) -> { ((Message)o).setImportance(n.getEnumValue(Importance.class)); }); + this.put("inferenceClassification", (o, n) -> { ((Message)o).setInferenceClassification(n.getEnumValue(InferenceClassificationType.class)); }); + this.put("internetMessageHeaders", (o, n) -> { ((Message)o).setInternetMessageHeaders(n.getCollectionOfObjectValues(InternetMessageHeader::createFromDiscriminatorValue)); }); + this.put("internetMessageId", (o, n) -> { ((Message)o).setInternetMessageId(n.getStringValue()); }); + this.put("isDeliveryReceiptRequested", (o, n) -> { ((Message)o).setIsDeliveryReceiptRequested(n.getBooleanValue()); }); + this.put("isDraft", (o, n) -> { ((Message)o).setIsDraft(n.getBooleanValue()); }); + this.put("isRead", (o, n) -> { ((Message)o).setIsRead(n.getBooleanValue()); }); + this.put("isReadReceiptRequested", (o, n) -> { ((Message)o).setIsReadReceiptRequested(n.getBooleanValue()); }); + this.put("multiValueExtendedProperties", (o, n) -> { ((Message)o).setMultiValueExtendedProperties(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + this.put("parentFolderId", (o, n) -> { ((Message)o).setParentFolderId(n.getStringValue()); }); + this.put("receivedDateTime", (o, n) -> { ((Message)o).setReceivedDateTime(n.getOffsetDateTimeValue()); }); + this.put("replyTo", (o, n) -> { ((Message)o).setReplyTo(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("sender", (o, n) -> { ((Message)o).setSender(n.getObjectValue(Recipient::createFromDiscriminatorValue)); }); + this.put("sentDateTime", (o, n) -> { ((Message)o).setSentDateTime(n.getOffsetDateTimeValue()); }); + this.put("singleValueExtendedProperties", (o, n) -> { ((Message)o).setSingleValueExtendedProperties(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + this.put("subject", (o, n) -> { ((Message)o).setSubject(n.getStringValue()); }); + this.put("toRecipients", (o, n) -> { ((Message)o).setToRecipients(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("uniqueBody", (o, n) -> { ((Message)o).setUniqueBody(n.getObjectValue(ItemBody::createFromDiscriminatorValue)); }); + this.put("webLink", (o, n) -> { ((Message)o).setWebLink(n.getStringValue()); }); + }}; + } /** * Gets the flag property value. * @return a followupFlag @@ -296,45 +345,6 @@ public ItemBody getUniqueBody() { public String getWebLink() { return this._webLink; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(super.getFieldDeserializers()) {{ - this.put("attachments", (o, n) -> { ((Message)o).setAttachments(n.getCollectionOfObjectValues(Attachment.class)); }); - this.put("bccRecipients", (o, n) -> { ((Message)o).setBccRecipients(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("body", (o, n) -> { ((Message)o).setBody(n.getObjectValue(ItemBody.class)); }); - this.put("bodyPreview", (o, n) -> { ((Message)o).setBodyPreview(n.getStringValue()); }); - this.put("ccRecipients", (o, n) -> { ((Message)o).setCcRecipients(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("conversationId", (o, n) -> { ((Message)o).setConversationId(n.getStringValue()); }); - this.put("conversationIndex", (o, n) -> { ((Message)o).setConversationIndex(n.getByteArrayValue()); }); - this.put("extensions", (o, n) -> { ((Message)o).setExtensions(n.getCollectionOfObjectValues(Extension.class)); }); - this.put("flag", (o, n) -> { ((Message)o).setFlag(n.getObjectValue(FollowupFlag.class)); }); - this.put("from", (o, n) -> { ((Message)o).setFrom(n.getObjectValue(Recipient.class)); }); - this.put("hasAttachments", (o, n) -> { ((Message)o).setHasAttachments(n.getBooleanValue()); }); - this.put("importance", (o, n) -> { ((Message)o).setImportance(n.getEnumValue(Importance.class)); }); - this.put("inferenceClassification", (o, n) -> { ((Message)o).setInferenceClassification(n.getEnumValue(InferenceClassificationType.class)); }); - this.put("internetMessageHeaders", (o, n) -> { ((Message)o).setInternetMessageHeaders(n.getCollectionOfObjectValues(InternetMessageHeader.class)); }); - this.put("internetMessageId", (o, n) -> { ((Message)o).setInternetMessageId(n.getStringValue()); }); - this.put("isDeliveryReceiptRequested", (o, n) -> { ((Message)o).setIsDeliveryReceiptRequested(n.getBooleanValue()); }); - this.put("isDraft", (o, n) -> { ((Message)o).setIsDraft(n.getBooleanValue()); }); - this.put("isRead", (o, n) -> { ((Message)o).setIsRead(n.getBooleanValue()); }); - this.put("isReadReceiptRequested", (o, n) -> { ((Message)o).setIsReadReceiptRequested(n.getBooleanValue()); }); - this.put("multiValueExtendedProperties", (o, n) -> { ((Message)o).setMultiValueExtendedProperties(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty.class)); }); - this.put("parentFolderId", (o, n) -> { ((Message)o).setParentFolderId(n.getStringValue()); }); - this.put("receivedDateTime", (o, n) -> { ((Message)o).setReceivedDateTime(n.getOffsetDateTimeValue()); }); - this.put("replyTo", (o, n) -> { ((Message)o).setReplyTo(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("sender", (o, n) -> { ((Message)o).setSender(n.getObjectValue(Recipient.class)); }); - this.put("sentDateTime", (o, n) -> { ((Message)o).setSentDateTime(n.getOffsetDateTimeValue()); }); - this.put("singleValueExtendedProperties", (o, n) -> { ((Message)o).setSingleValueExtendedProperties(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty.class)); }); - this.put("subject", (o, n) -> { ((Message)o).setSubject(n.getStringValue()); }); - this.put("toRecipients", (o, n) -> { ((Message)o).setToRecipients(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("uniqueBody", (o, n) -> { ((Message)o).setUniqueBody(n.getObjectValue(ItemBody.class)); }); - this.put("webLink", (o, n) -> { ((Message)o).setWebLink(n.getStringValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRule.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRule.java index a4763df66..6ca4fbc97 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRule.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRule.java @@ -28,6 +28,16 @@ public class MessageRule extends Entity implements Parsable { public MessageRule() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messageRule + */ + @javax.annotation.Nonnull + public static MessageRule createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessageRule(); + } /** * Gets the actions property value. * @return a messageRuleActions @@ -60,6 +70,23 @@ public String getDisplayName() { public MessageRulePredicates getExceptions() { return this._exceptions; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(super.getFieldDeserializers()) {{ + this.put("actions", (o, n) -> { ((MessageRule)o).setActions(n.getObjectValue(MessageRuleActions::createFromDiscriminatorValue)); }); + this.put("conditions", (o, n) -> { ((MessageRule)o).setConditions(n.getObjectValue(MessageRulePredicates::createFromDiscriminatorValue)); }); + this.put("displayName", (o, n) -> { ((MessageRule)o).setDisplayName(n.getStringValue()); }); + this.put("exceptions", (o, n) -> { ((MessageRule)o).setExceptions(n.getObjectValue(MessageRulePredicates::createFromDiscriminatorValue)); }); + this.put("hasError", (o, n) -> { ((MessageRule)o).setHasError(n.getBooleanValue()); }); + this.put("isEnabled", (o, n) -> { ((MessageRule)o).setIsEnabled(n.getBooleanValue()); }); + this.put("isReadOnly", (o, n) -> { ((MessageRule)o).setIsReadOnly(n.getBooleanValue()); }); + this.put("sequence", (o, n) -> { ((MessageRule)o).setSequence(n.getIntegerValue()); }); + }}; + } /** * Gets the hasError property value. Indicates whether the rule is in an error condition. Read-only. * @return a boolean @@ -92,23 +119,6 @@ public Boolean getIsReadOnly() { public Integer getSequence() { return this._sequence; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(super.getFieldDeserializers()) {{ - this.put("actions", (o, n) -> { ((MessageRule)o).setActions(n.getObjectValue(MessageRuleActions.class)); }); - this.put("conditions", (o, n) -> { ((MessageRule)o).setConditions(n.getObjectValue(MessageRulePredicates.class)); }); - this.put("displayName", (o, n) -> { ((MessageRule)o).setDisplayName(n.getStringValue()); }); - this.put("exceptions", (o, n) -> { ((MessageRule)o).setExceptions(n.getObjectValue(MessageRulePredicates.class)); }); - this.put("hasError", (o, n) -> { ((MessageRule)o).setHasError(n.getBooleanValue()); }); - this.put("isEnabled", (o, n) -> { ((MessageRule)o).setIsEnabled(n.getBooleanValue()); }); - this.put("isReadOnly", (o, n) -> { ((MessageRule)o).setIsReadOnly(n.getBooleanValue()); }); - this.put("sequence", (o, n) -> { ((MessageRule)o).setSequence(n.getIntegerValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRuleActions.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRuleActions.java index e3d90b7a4..b7c881737 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRuleActions.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRuleActions.java @@ -38,6 +38,16 @@ public class MessageRuleActions implements Parsable { public MessageRuleActions() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messageRuleActions + */ + @javax.annotation.Nonnull + public static MessageRuleActions createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessageRuleActions(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -70,6 +80,26 @@ public String getCopyToFolder() { public Boolean getDelete() { return this._delete; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(11) {{ + this.put("assignCategories", (o, n) -> { ((MessageRuleActions)o).setAssignCategories(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("copyToFolder", (o, n) -> { ((MessageRuleActions)o).setCopyToFolder(n.getStringValue()); }); + this.put("delete", (o, n) -> { ((MessageRuleActions)o).setDelete(n.getBooleanValue()); }); + this.put("forwardAsAttachmentTo", (o, n) -> { ((MessageRuleActions)o).setForwardAsAttachmentTo(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("forwardTo", (o, n) -> { ((MessageRuleActions)o).setForwardTo(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("markAsRead", (o, n) -> { ((MessageRuleActions)o).setMarkAsRead(n.getBooleanValue()); }); + this.put("markImportance", (o, n) -> { ((MessageRuleActions)o).setMarkImportance(n.getEnumValue(Importance.class)); }); + this.put("moveToFolder", (o, n) -> { ((MessageRuleActions)o).setMoveToFolder(n.getStringValue()); }); + this.put("permanentDelete", (o, n) -> { ((MessageRuleActions)o).setPermanentDelete(n.getBooleanValue()); }); + this.put("redirectTo", (o, n) -> { ((MessageRuleActions)o).setRedirectTo(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("stopProcessingRules", (o, n) -> { ((MessageRuleActions)o).setStopProcessingRules(n.getBooleanValue()); }); + }}; + } /** * Gets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. * @return a recipient @@ -134,26 +164,6 @@ public java.util.List getRedirectTo() { public Boolean getStopProcessingRules() { return this._stopProcessingRules; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(11) {{ - this.put("assignCategories", (o, n) -> { ((MessageRuleActions)o).setAssignCategories(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("copyToFolder", (o, n) -> { ((MessageRuleActions)o).setCopyToFolder(n.getStringValue()); }); - this.put("delete", (o, n) -> { ((MessageRuleActions)o).setDelete(n.getBooleanValue()); }); - this.put("forwardAsAttachmentTo", (o, n) -> { ((MessageRuleActions)o).setForwardAsAttachmentTo(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("forwardTo", (o, n) -> { ((MessageRuleActions)o).setForwardTo(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("markAsRead", (o, n) -> { ((MessageRuleActions)o).setMarkAsRead(n.getBooleanValue()); }); - this.put("markImportance", (o, n) -> { ((MessageRuleActions)o).setMarkImportance(n.getEnumValue(Importance.class)); }); - this.put("moveToFolder", (o, n) -> { ((MessageRuleActions)o).setMoveToFolder(n.getStringValue()); }); - this.put("permanentDelete", (o, n) -> { ((MessageRuleActions)o).setPermanentDelete(n.getBooleanValue()); }); - this.put("redirectTo", (o, n) -> { ((MessageRuleActions)o).setRedirectTo(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("stopProcessingRules", (o, n) -> { ((MessageRuleActions)o).setStopProcessingRules(n.getBooleanValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRulePredicates.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRulePredicates.java index 2093e06bd..799ab07ff 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRulePredicates.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MessageRulePredicates.java @@ -73,6 +73,16 @@ public class MessageRulePredicates implements Parsable { public MessageRulePredicates() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messageRulePredicates + */ + @javax.annotation.Nonnull + public static MessageRulePredicates createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessageRulePredicates(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -105,6 +115,45 @@ public java.util.List getBodyOrSubjectContains() { public java.util.List getCategories() { return this._categories; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(30) {{ + this.put("bodyContains", (o, n) -> { ((MessageRulePredicates)o).setBodyContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("bodyOrSubjectContains", (o, n) -> { ((MessageRulePredicates)o).setBodyOrSubjectContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("categories", (o, n) -> { ((MessageRulePredicates)o).setCategories(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("fromAddresses", (o, n) -> { ((MessageRulePredicates)o).setFromAddresses(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("hasAttachments", (o, n) -> { ((MessageRulePredicates)o).setHasAttachments(n.getBooleanValue()); }); + this.put("headerContains", (o, n) -> { ((MessageRulePredicates)o).setHeaderContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("importance", (o, n) -> { ((MessageRulePredicates)o).setImportance(n.getEnumValue(Importance.class)); }); + this.put("isApprovalRequest", (o, n) -> { ((MessageRulePredicates)o).setIsApprovalRequest(n.getBooleanValue()); }); + this.put("isAutomaticForward", (o, n) -> { ((MessageRulePredicates)o).setIsAutomaticForward(n.getBooleanValue()); }); + this.put("isAutomaticReply", (o, n) -> { ((MessageRulePredicates)o).setIsAutomaticReply(n.getBooleanValue()); }); + this.put("isEncrypted", (o, n) -> { ((MessageRulePredicates)o).setIsEncrypted(n.getBooleanValue()); }); + this.put("isMeetingRequest", (o, n) -> { ((MessageRulePredicates)o).setIsMeetingRequest(n.getBooleanValue()); }); + this.put("isMeetingResponse", (o, n) -> { ((MessageRulePredicates)o).setIsMeetingResponse(n.getBooleanValue()); }); + this.put("isNonDeliveryReport", (o, n) -> { ((MessageRulePredicates)o).setIsNonDeliveryReport(n.getBooleanValue()); }); + this.put("isPermissionControlled", (o, n) -> { ((MessageRulePredicates)o).setIsPermissionControlled(n.getBooleanValue()); }); + this.put("isReadReceipt", (o, n) -> { ((MessageRulePredicates)o).setIsReadReceipt(n.getBooleanValue()); }); + this.put("isSigned", (o, n) -> { ((MessageRulePredicates)o).setIsSigned(n.getBooleanValue()); }); + this.put("isVoicemail", (o, n) -> { ((MessageRulePredicates)o).setIsVoicemail(n.getBooleanValue()); }); + this.put("messageActionFlag", (o, n) -> { ((MessageRulePredicates)o).setMessageActionFlag(n.getEnumValue(MessageActionFlag.class)); }); + this.put("notSentToMe", (o, n) -> { ((MessageRulePredicates)o).setNotSentToMe(n.getBooleanValue()); }); + this.put("recipientContains", (o, n) -> { ((MessageRulePredicates)o).setRecipientContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("senderContains", (o, n) -> { ((MessageRulePredicates)o).setSenderContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("sensitivity", (o, n) -> { ((MessageRulePredicates)o).setSensitivity(n.getEnumValue(Sensitivity.class)); }); + this.put("sentCcMe", (o, n) -> { ((MessageRulePredicates)o).setSentCcMe(n.getBooleanValue()); }); + this.put("sentOnlyToMe", (o, n) -> { ((MessageRulePredicates)o).setSentOnlyToMe(n.getBooleanValue()); }); + this.put("sentToAddresses", (o, n) -> { ((MessageRulePredicates)o).setSentToAddresses(n.getCollectionOfObjectValues(Recipient::createFromDiscriminatorValue)); }); + this.put("sentToMe", (o, n) -> { ((MessageRulePredicates)o).setSentToMe(n.getBooleanValue()); }); + this.put("sentToOrCcMe", (o, n) -> { ((MessageRulePredicates)o).setSentToOrCcMe(n.getBooleanValue()); }); + this.put("subjectContains", (o, n) -> { ((MessageRulePredicates)o).setSubjectContains(n.getCollectionOfPrimitiveValues(String.class)); }); + this.put("withinSizeRange", (o, n) -> { ((MessageRulePredicates)o).setWithinSizeRange(n.getObjectValue(SizeRange::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. * @return a recipient @@ -321,45 +370,6 @@ public java.util.List getSubjectContains() { public SizeRange getWithinSizeRange() { return this._withinSizeRange; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(30) {{ - this.put("bodyContains", (o, n) -> { ((MessageRulePredicates)o).setBodyContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("bodyOrSubjectContains", (o, n) -> { ((MessageRulePredicates)o).setBodyOrSubjectContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("categories", (o, n) -> { ((MessageRulePredicates)o).setCategories(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("fromAddresses", (o, n) -> { ((MessageRulePredicates)o).setFromAddresses(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("hasAttachments", (o, n) -> { ((MessageRulePredicates)o).setHasAttachments(n.getBooleanValue()); }); - this.put("headerContains", (o, n) -> { ((MessageRulePredicates)o).setHeaderContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("importance", (o, n) -> { ((MessageRulePredicates)o).setImportance(n.getEnumValue(Importance.class)); }); - this.put("isApprovalRequest", (o, n) -> { ((MessageRulePredicates)o).setIsApprovalRequest(n.getBooleanValue()); }); - this.put("isAutomaticForward", (o, n) -> { ((MessageRulePredicates)o).setIsAutomaticForward(n.getBooleanValue()); }); - this.put("isAutomaticReply", (o, n) -> { ((MessageRulePredicates)o).setIsAutomaticReply(n.getBooleanValue()); }); - this.put("isEncrypted", (o, n) -> { ((MessageRulePredicates)o).setIsEncrypted(n.getBooleanValue()); }); - this.put("isMeetingRequest", (o, n) -> { ((MessageRulePredicates)o).setIsMeetingRequest(n.getBooleanValue()); }); - this.put("isMeetingResponse", (o, n) -> { ((MessageRulePredicates)o).setIsMeetingResponse(n.getBooleanValue()); }); - this.put("isNonDeliveryReport", (o, n) -> { ((MessageRulePredicates)o).setIsNonDeliveryReport(n.getBooleanValue()); }); - this.put("isPermissionControlled", (o, n) -> { ((MessageRulePredicates)o).setIsPermissionControlled(n.getBooleanValue()); }); - this.put("isReadReceipt", (o, n) -> { ((MessageRulePredicates)o).setIsReadReceipt(n.getBooleanValue()); }); - this.put("isSigned", (o, n) -> { ((MessageRulePredicates)o).setIsSigned(n.getBooleanValue()); }); - this.put("isVoicemail", (o, n) -> { ((MessageRulePredicates)o).setIsVoicemail(n.getBooleanValue()); }); - this.put("messageActionFlag", (o, n) -> { ((MessageRulePredicates)o).setMessageActionFlag(n.getEnumValue(MessageActionFlag.class)); }); - this.put("notSentToMe", (o, n) -> { ((MessageRulePredicates)o).setNotSentToMe(n.getBooleanValue()); }); - this.put("recipientContains", (o, n) -> { ((MessageRulePredicates)o).setRecipientContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("senderContains", (o, n) -> { ((MessageRulePredicates)o).setSenderContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("sensitivity", (o, n) -> { ((MessageRulePredicates)o).setSensitivity(n.getEnumValue(Sensitivity.class)); }); - this.put("sentCcMe", (o, n) -> { ((MessageRulePredicates)o).setSentCcMe(n.getBooleanValue()); }); - this.put("sentOnlyToMe", (o, n) -> { ((MessageRulePredicates)o).setSentOnlyToMe(n.getBooleanValue()); }); - this.put("sentToAddresses", (o, n) -> { ((MessageRulePredicates)o).setSentToAddresses(n.getCollectionOfObjectValues(Recipient.class)); }); - this.put("sentToMe", (o, n) -> { ((MessageRulePredicates)o).setSentToMe(n.getBooleanValue()); }); - this.put("sentToOrCcMe", (o, n) -> { ((MessageRulePredicates)o).setSentToOrCcMe(n.getBooleanValue()); }); - this.put("subjectContains", (o, n) -> { ((MessageRulePredicates)o).setSubjectContains(n.getCollectionOfPrimitiveValues(String.class)); }); - this.put("withinSizeRange", (o, n) -> { ((MessageRulePredicates)o).setWithinSizeRange(n.getObjectValue(SizeRange.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MultiValueLegacyExtendedProperty.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MultiValueLegacyExtendedProperty.java index 40d018c13..6a4121144 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MultiValueLegacyExtendedProperty.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/MultiValueLegacyExtendedProperty.java @@ -18,12 +18,14 @@ public MultiValueLegacyExtendedProperty() { super(); } /** - * Gets the value property value. A collection of property values. - * @return a string + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a multiValueLegacyExtendedProperty */ - @javax.annotation.Nullable - public java.util.List getValue() { - return this._value; + @javax.annotation.Nonnull + public static MultiValueLegacyExtendedProperty createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MultiValueLegacyExtendedProperty(); } /** * The deserialization information for the current model @@ -35,6 +37,14 @@ public Map> getFieldDeserializers() { this.put("value", (o, n) -> { ((MultiValueLegacyExtendedProperty)o).setValue(n.getCollectionOfPrimitiveValues(String.class)); }); }}; } + /** + * Gets the value property value. A collection of property values. + * @return a string + */ + @javax.annotation.Nullable + public java.util.List getValue() { + return this._value; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/OutlookItem.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/OutlookItem.java index 1d060858c..533f00f8e 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/OutlookItem.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/OutlookItem.java @@ -24,6 +24,16 @@ public class OutlookItem extends Entity implements Parsable { public OutlookItem() { super(); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a outlookItem + */ + @javax.annotation.Nonnull + public static OutlookItem createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new OutlookItem(); + } /** * Gets the categories property value. The categories associated with the item * @return a string @@ -48,14 +58,6 @@ public String getChangeKey() { public OffsetDateTime getCreatedDateTime() { return this._createdDateTime; } - /** - * Gets the lastModifiedDateTime property value. 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 - * @return a OffsetDateTime - */ - @javax.annotation.Nullable - public OffsetDateTime getLastModifiedDateTime() { - return this._lastModifiedDateTime; - } /** * The deserialization information for the current model * @return a Map> @@ -69,6 +71,14 @@ public Map> getFieldDeserializers() { this.put("lastModifiedDateTime", (o, n) -> { ((OutlookItem)o).setLastModifiedDateTime(n.getOffsetDateTimeValue()); }); }}; } + /** + * Gets the lastModifiedDateTime property value. 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 + * @return a OffsetDateTime + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModifiedDateTime() { + return this._lastModifiedDateTime; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Recipient.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Recipient.java index 4727e45c8..d59dc2474 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Recipient.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/Recipient.java @@ -18,6 +18,16 @@ public class Recipient implements Parsable { public Recipient() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a recipient + */ + @javax.annotation.Nonnull + public static Recipient createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new Recipient(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -41,7 +51,7 @@ public EmailAddress getEmailAddress() { @javax.annotation.Nonnull public Map> getFieldDeserializers() { return new HashMap<>(1) {{ - this.put("emailAddress", (o, n) -> { ((Recipient)o).setEmailAddress(n.getObjectValue(EmailAddress.class)); }); + this.put("emailAddress", (o, n) -> { ((Recipient)o).setEmailAddress(n.getObjectValue(EmailAddress::createFromDiscriminatorValue)); }); }}; } /** diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SingleValueLegacyExtendedProperty.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SingleValueLegacyExtendedProperty.java index bede21037..900558abd 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SingleValueLegacyExtendedProperty.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SingleValueLegacyExtendedProperty.java @@ -18,12 +18,14 @@ public SingleValueLegacyExtendedProperty() { super(); } /** - * Gets the value property value. A property value. - * @return a string + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a singleValueLegacyExtendedProperty */ - @javax.annotation.Nullable - public String getValue() { - return this._value; + @javax.annotation.Nonnull + public static SingleValueLegacyExtendedProperty createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new SingleValueLegacyExtendedProperty(); } /** * The deserialization information for the current model @@ -35,6 +37,14 @@ public Map> getFieldDeserializers() { this.put("value", (o, n) -> { ((SingleValueLegacyExtendedProperty)o).setValue(n.getStringValue()); }); }}; } + /** + * Gets the value property value. A property value. + * @return a string + */ + @javax.annotation.Nullable + public String getValue() { + return this._value; + } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SizeRange.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SizeRange.java index 284a0a1f3..4ab3f8a9d 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SizeRange.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/models/microsoft/graph/SizeRange.java @@ -21,6 +21,16 @@ public class SizeRange implements Parsable { public SizeRange() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a sizeRange + */ + @javax.annotation.Nonnull + public static SizeRange createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new SizeRange(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -29,6 +39,17 @@ public SizeRange() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("maximumSize", (o, n) -> { ((SizeRange)o).setMaximumSize(n.getIntegerValue()); }); + this.put("minimumSize", (o, n) -> { ((SizeRange)o).setMinimumSize(n.getIntegerValue()); }); + }}; + } /** * Gets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. * @return a integer @@ -45,17 +66,6 @@ public Integer getMaximumSize() { public Integer getMinimumSize() { return this._minimumSize; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("maximumSize", (o, n) -> { ((SizeRange)o).setMaximumSize(n.getIntegerValue()); }); - this.put("minimumSize", (o, n) -> { ((SizeRange)o).setMinimumSize(n.getIntegerValue()); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserItemRequestBuilder.java similarity index 69% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserItemRequestBuilder.java index 1e98441d4..2af864ee3 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/UserItemRequestBuilder.java @@ -1,15 +1,15 @@ package graphjavav4.utilities.users.item; import com.microsoft.kiota.RequestAdapter; -import graphjavav4.utilities.users.item.inferenceClassification.InferenceClassificationRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.MailFolderRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.MailFoldersRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.MessageRequestBuilder; +import graphjavav4.utilities.users.item.inferenceclassification.InferenceClassificationRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.MailFolderItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.MailFoldersRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.MessageItemRequestBuilder; import graphjavav4.utilities.users.item.messages.MessagesRequestBuilder; import java.util.HashMap; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id} */ -public class UserRequestBuilder { +public class UserItemRequestBuilder { @javax.annotation.Nonnull public InferenceClassificationRequestBuilder inferenceClassification() { return new InferenceClassificationRequestBuilder(pathParameters, requestAdapter); @@ -29,12 +29,12 @@ public MessagesRequestBuilder messages() { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new UserRequestBuilder and sets the default values. + * Instantiates a new UserItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public UserRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public UserItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}"; @@ -43,12 +43,12 @@ public UserRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -58,25 +58,25 @@ public UserRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax. /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item collection * @param id Unique identifier of the item - * @return a mailFolderRequestBuilder + * @return a mailFolderItemRequestBuilder */ @javax.annotation.Nonnull - public MailFolderRequestBuilder mailFolders(@javax.annotation.Nonnull final String id) { + public MailFolderItemRequestBuilder mailFolders(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("mailFolder_id", id); - return new MailFolderRequestBuilder(urlTplParams, requestAdapter); + return new MailFolderItemRequestBuilder(urlTplParams, requestAdapter); } /** * Gets an item from the graphjavav4.utilities.users.item.messages.item collection * @param id Unique identifier of the item - * @return a messageRequestBuilder + * @return a messageItemRequestBuilder */ @javax.annotation.Nonnull - public MessageRequestBuilder messages(@javax.annotation.Nonnull final String id) { + public MessageItemRequestBuilder messages(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("message_id", id); - return new MessageRequestBuilder(urlTplParams, requestAdapter); + return new MessageItemRequestBuilder(urlTplParams, requestAdapter); } } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/InferenceClassificationRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/InferenceClassificationRequestBuilder.java index f81ed687d..c6ff15b29 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/InferenceClassificationRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/InferenceClassificationRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.inferenceClassification; +package graphjavav4.utilities.users.item.inferenceclassification; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,9 +7,10 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.InferenceClassification; -import graphjavav4.utilities.users.item.inferenceClassification.overrides.item.InferenceClassificationOverrideRequestBuilder; -import graphjavav4.utilities.users.item.inferenceClassification.overrides.OverridesRequestBuilder; +import graphjavav4.utilities.users.item.inferenceclassification.overrides.item.InferenceClassificationOverrideItemRequestBuilder; +import graphjavav4.utilities.users.item.inferenceclassification.overrides.OverridesRequestBuilder; import java.net.URISyntaxException; import java.util.Collection; import java.util.HashMap; @@ -196,7 +197,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -209,7 +210,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -238,7 +239,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -250,7 +251,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassification.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassification::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -263,7 +264,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassification.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassification::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -277,7 +278,7 @@ public java.util.concurrent.CompletableFuture get(@java public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassification.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassification::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -292,7 +293,7 @@ public java.util.concurrent.CompletableFuture get(@java public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassification.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassification::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -308,7 +309,7 @@ public java.util.concurrent.CompletableFuture get(@java public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassification.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassification::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -316,14 +317,14 @@ public java.util.concurrent.CompletableFuture get(@java /** * Gets an item from the graphjavav4.utilities.users.item.inferenceClassification.overrides.item collection * @param id Unique identifier of the item - * @return a inferenceClassificationOverrideRequestBuilder + * @return a inferenceClassificationOverrideItemRequestBuilder */ @javax.annotation.Nonnull - public InferenceClassificationOverrideRequestBuilder overrides(@javax.annotation.Nonnull final String id) { + public InferenceClassificationOverrideItemRequestBuilder overrides(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("inferenceClassificationOverride_id", id); - return new InferenceClassificationOverrideRequestBuilder(urlTplParams, requestAdapter); + return new InferenceClassificationOverrideItemRequestBuilder(urlTplParams, requestAdapter); } /** * Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. @@ -333,7 +334,7 @@ public InferenceClassificationOverrideRequestBuilder overrides(@javax.annotation public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassification body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -347,7 +348,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassification body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -362,7 +363,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassification body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -379,7 +380,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesRequestBuilder.java index ed9effe34..25719e16a 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.inferenceClassification.overrides; +package graphjavav4.utilities.users.item.inferenceclassification.overrides; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.InferenceClassificationOverride; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, OverridesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, OverridesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, OverridesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, OverridesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.anno public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, OverridesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, OverridesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.anno public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, OverridesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, OverridesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.anno public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, OverridesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, OverridesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.anno public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final InferenceClassificationOverride body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture p public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final InferenceClassificationOverride body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture p public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final InferenceClassificationOverride body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture p Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesResponse.java index 0bbc8b2d2..ad24ffcf6 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/OverridesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.inferenceClassification.overrides; +package graphjavav4.utilities.users.item.inferenceclassification.overrides; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class OverridesResponse implements Parsable { public OverridesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a overridesResponse + */ + @javax.annotation.Nonnull + public static OverridesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new OverridesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public OverridesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((OverridesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((OverridesResponse)o).setValue(n.getCollectionOfObjectValues(InferenceClassificationOverride::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((OverridesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((OverridesResponse)o).setValue(n.getCollectionOfObjectValues(InferenceClassificationOverride.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideItemRequestBuilder.java index 85e3d77b5..d71226f64 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/inferenceClassification/overrides/item/InferenceClassificationOverrideItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.inferenceClassification.overrides.item; +package graphjavav4.utilities.users.item.inferenceclassification.overrides.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.InferenceClassificationOverride; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/inferenceClassification/overrides/{inferenceClassificationOverride-id} */ -public class InferenceClassificationOverrideRequestBuilder { +public class InferenceClassificationOverrideItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class InferenceClassificationOverrideRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. + * Instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public InferenceClassificationOverrideRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public InferenceClassificationOverrideItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; @@ -36,12 +37,12 @@ public InferenceClassificationOverrideRequestBuilder(@javax.annotation.Nonnull f this.requestAdapter = requestAdapter; } /** - * Instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. + * Instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public InferenceClassificationOverrideRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public InferenceClassificationOverrideItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture g public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture g public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture g public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, null); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture g public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, InferenceClassificationOverride::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture g public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassificationOverride body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassificationOverride body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final InferenceClassificationOverride body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersRequestBuilder.java index 226e942ab..7c7b0f975 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders; +package graphjavav4.utilities.users.item.mailfolders; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MailFolder; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MailFoldersResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersResponse.java index c70eb04ec..90cdc2382 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/MailFoldersResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders; +package graphjavav4.utilities.users.item.mailfolders; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MailFoldersResponse implements Parsable { public MailFoldersResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a mailFoldersResponse + */ + @javax.annotation.Nonnull + public static MailFoldersResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MailFoldersResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MailFoldersResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MailFoldersResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MailFoldersResponse)o).setValue(n.getCollectionOfObjectValues(MailFolder::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MailFoldersResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MailFoldersResponse)o).setValue(n.getCollectionOfObjectValues(MailFolder.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderItemRequestBuilder.java similarity index 85% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderItemRequestBuilder.java index 3a624b041..9ec9c3305 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/MailFolderItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item; +package graphjavav4.utilities.users.item.mailfolders.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,23 +7,24 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MailFolder; -import graphjavav4.utilities.users.item.mailFolders.item.childFolders.ChildFoldersRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messageRules.item.MessageRuleRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messageRules.MessageRulesRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.MessageRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.MessagesRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties.item.MultiValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties.MultiValueExtendedPropertiesRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties.item.SingleValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties.SingleValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.childfolders.ChildFoldersRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messagerules.item.MessageRuleItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messagerules.MessageRulesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.MessageItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.MessagesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.multivalueextendedproperties.item.MultiValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.multivalueextendedproperties.MultiValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.singlevalueextendedproperties.item.SingleValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.singlevalueextendedproperties.SingleValueExtendedPropertiesRequestBuilder; import java.net.URISyntaxException; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id} */ -public class MailFolderRequestBuilder { +public class MailFolderItemRequestBuilder { @javax.annotation.Nonnull public ChildFoldersRequestBuilder childFolders() { return new ChildFoldersRequestBuilder(pathParameters, requestAdapter); @@ -53,22 +54,22 @@ public SingleValueExtendedPropertiesRequestBuilder singleValueExtendedProperties /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.childFolders.item collection * @param id Unique identifier of the item - * @return a mailFolderRequestBuilder + * @return a mailFolderItemRequestBuilder */ @javax.annotation.Nonnull - public MailFolderRequestBuilder childFolders(@javax.annotation.Nonnull final String id) { + public MailFolderItemRequestBuilder childFolders(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("mailFolder_id1", id); - return new MailFolderRequestBuilder(urlTplParams, requestAdapter); + return new MailFolderItemRequestBuilder(urlTplParams, requestAdapter); } /** - * Instantiates a new MailFolderRequestBuilder and sets the default values. + * Instantiates a new MailFolderItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MailFolderRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}{?select}"; @@ -77,12 +78,12 @@ public MailFolderRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -231,7 +232,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -258,7 +259,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -273,7 +274,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -285,7 +286,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -298,7 +299,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -312,7 +313,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -327,7 +328,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -343,7 +344,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -351,38 +352,38 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messageRules.item collection * @param id Unique identifier of the item - * @return a messageRuleRequestBuilder + * @return a messageRuleItemRequestBuilder */ @javax.annotation.Nonnull - public MessageRuleRequestBuilder messageRules(@javax.annotation.Nonnull final String id) { + public MessageRuleItemRequestBuilder messageRules(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("messageRule_id", id); - return new MessageRuleRequestBuilder(urlTplParams, requestAdapter); + return new MessageRuleItemRequestBuilder(urlTplParams, requestAdapter); } /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messages.item collection * @param id Unique identifier of the item - * @return a messageRequestBuilder + * @return a messageItemRequestBuilder */ @javax.annotation.Nonnull - public MessageRequestBuilder messages(@javax.annotation.Nonnull final String id) { + public MessageItemRequestBuilder messages(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("message_id", id); - return new MessageRequestBuilder(urlTplParams, requestAdapter); + return new MessageItemRequestBuilder(urlTplParams, requestAdapter); } /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a multiValueLegacyExtendedPropertyRequestBuilder + * @return a multiValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** * The user's mail folders. Read-only. Nullable. @@ -392,7 +393,7 @@ public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperti public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -406,7 +407,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -421,7 +422,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -438,7 +439,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -446,14 +447,14 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a singleValueLegacyExtendedPropertyRequestBuilder + * @return a singleValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public SingleValueLegacyExtendedPropertyRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** The user's mail folders. Read-only. Nullable. */ public class GetQueryParameters extends QueryParametersBase { diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersRequestBuilder.java index a911fd791..a03887de7 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.childFolders; +package graphjavav4.utilities.users.item.mailfolders.item.childfolders; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MailFolder; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, ChildFoldersResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersResponse.java index 5ba854766..56beb1df2 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/ChildFoldersResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.childFolders; +package graphjavav4.utilities.users.item.mailfolders.item.childfolders; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class ChildFoldersResponse implements Parsable { public ChildFoldersResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a childFoldersResponse + */ + @javax.annotation.Nonnull + public static ChildFoldersResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new ChildFoldersResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public ChildFoldersResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((ChildFoldersResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((ChildFoldersResponse)o).setValue(n.getCollectionOfObjectValues(MailFolder::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((ChildFoldersResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((ChildFoldersResponse)o).setValue(n.getCollectionOfObjectValues(MailFolder.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderItemRequestBuilder.java index c6352de1b..57109db0b 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/childFolders/item/MailFolderItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.childFolders.item; +package graphjavav4.utilities.users.item.mailfolders.item.childfolders.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MailFolder; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/childFolders/{mailFolder-id1} */ -public class MailFolderRequestBuilder { +public class MailFolderItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class MailFolderRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new MailFolderRequestBuilder and sets the default values. + * Instantiates a new MailFolderItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MailFolderRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MailFolderItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders/{mailFolder_id1}{?select,expand}"; @@ -36,12 +37,12 @@ public MailFolderRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, null); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MailFolder.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MailFolder::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MailFolder body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesRequestBuilder.java index 81903d89a..3c5981349 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messageRules; +package graphjavav4.utilities.users.item.mailfolders.item.messagerules; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MessageRule; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MessageRulesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.a public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MessageRule body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotatio public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MessageRule body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotatio public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MessageRule body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotatio Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesResponse.java index 727549693..5e789f118 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/MessageRulesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messageRules; +package graphjavav4.utilities.users.item.mailfolders.item.messagerules; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MessageRulesResponse implements Parsable { public MessageRulesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messageRulesResponse + */ + @javax.annotation.Nonnull + public static MessageRulesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessageRulesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MessageRulesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MessageRulesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MessageRulesResponse)o).setValue(n.getCollectionOfObjectValues(MessageRule::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MessageRulesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MessageRulesResponse)o).setValue(n.getCollectionOfObjectValues(MessageRule.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleItemRequestBuilder.java index 4241ab855..ecef97bef 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messageRules/item/MessageRuleItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messageRules.item; +package graphjavav4.utilities.users.item.mailfolders.item.messagerules.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MessageRule; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messageRules/{messageRule-id} */ -public class MessageRuleRequestBuilder { +public class MessageRuleItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class MessageRuleRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new MessageRuleRequestBuilder and sets the default values. + * Instantiates a new MessageRuleItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MessageRuleRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MessageRuleItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules/{messageRule_id}{?select}"; @@ -36,12 +37,12 @@ public MessageRuleRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessageRule.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MessageRule::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MessageRule body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MessageRule body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MessageRule body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesRequestBuilder.java index e02e3cf6a..2bf34ebf2 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages; +package graphjavav4.utilities.users.item.mailfolders.item.messages; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Message; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesResponse.java index b881fc14b..688908a1b 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/MessagesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages; +package graphjavav4.utilities.users.item.mailfolders.item.messages; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MessagesResponse implements Parsable { public MessagesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messagesResponse + */ + @javax.annotation.Nonnull + public static MessagesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessagesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MessagesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MessagesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MessagesResponse)o).setValue(n.getCollectionOfObjectValues(Message::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MessagesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MessagesResponse)o).setValue(n.getCollectionOfObjectValues(Message.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageItemRequestBuilder.java similarity index 86% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageItemRequestBuilder.java index 89c0ba929..6574eb910 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/MessageItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,23 +7,24 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Message; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments.AttachmentsRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments.item.AttachmentRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions.ExtensionsRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions.item.ExtensionRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item.MultiValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.MultiValueExtendedPropertiesRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item.SingleValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.SingleValueExtendedPropertiesRequestBuilder; -import graphjavav4.utilities.users.item.mailFolders.item.messages.item.value.ContentRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.attachments.AttachmentsRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.attachments.item.AttachmentItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.extensions.ExtensionsRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.extensions.item.ExtensionItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.multivalueextendedproperties.item.MultiValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.multivalueextendedproperties.MultiValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.singlevalueextendedproperties.item.SingleValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.singlevalueextendedproperties.SingleValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.mailfolders.item.messages.item.value.ContentRequestBuilder; import java.net.URISyntaxException; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id} */ -public class MessageRequestBuilder { +public class MessageItemRequestBuilder { @javax.annotation.Nonnull public AttachmentsRequestBuilder attachments() { return new AttachmentsRequestBuilder(pathParameters, requestAdapter); @@ -53,22 +54,22 @@ public SingleValueExtendedPropertiesRequestBuilder singleValueExtendedProperties /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments.item collection * @param id Unique identifier of the item - * @return a attachmentRequestBuilder + * @return a attachmentItemRequestBuilder */ @javax.annotation.Nonnull - public AttachmentRequestBuilder attachments(@javax.annotation.Nonnull final String id) { + public AttachmentItemRequestBuilder attachments(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("attachment_id", id); - return new AttachmentRequestBuilder(urlTplParams, requestAdapter); + return new AttachmentItemRequestBuilder(urlTplParams, requestAdapter); } /** - * Instantiates a new MessageRequestBuilder and sets the default values. + * Instantiates a new MessageItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MessageRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MessageItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}{?select,expand}"; @@ -77,12 +78,12 @@ public MessageRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -231,7 +232,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -258,7 +259,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -273,7 +274,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -281,14 +282,14 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions.item collection * @param id Unique identifier of the item - * @return a extensionRequestBuilder + * @return a extensionItemRequestBuilder */ @javax.annotation.Nonnull - public ExtensionRequestBuilder extensions(@javax.annotation.Nonnull final String id) { + public ExtensionItemRequestBuilder extensions(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("extension_id", id); - return new ExtensionRequestBuilder(urlTplParams, requestAdapter); + return new ExtensionItemRequestBuilder(urlTplParams, requestAdapter); } /** * The collection of messages in the mailFolder. @@ -297,7 +298,7 @@ public ExtensionRequestBuilder extensions(@javax.annotation.Nonnull final String public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -310,7 +311,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -324,7 +325,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -339,7 +340,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -355,7 +356,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -363,14 +364,14 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a multiValueLegacyExtendedPropertyRequestBuilder + * @return a multiValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** * The collection of messages in the mailFolder. @@ -380,7 +381,7 @@ public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperti public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -394,7 +395,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -409,7 +410,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -426,7 +427,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -434,14 +435,14 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn /** * Gets an item from the graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a singleValueLegacyExtendedPropertyRequestBuilder + * @return a singleValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public SingleValueLegacyExtendedPropertyRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** The collection of messages in the mailFolder. */ public class GetQueryParameters extends QueryParametersBase { diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsRequestBuilder.java index 01ec99a49..e3ca67531 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.attachments; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Attachment; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsResponse.java index 869bbe0b2..cb62bac76 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/AttachmentsResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.attachments; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class AttachmentsResponse implements Parsable { public AttachmentsResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a attachmentsResponse + */ + @javax.annotation.Nonnull + public static AttachmentsResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new AttachmentsResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public AttachmentsResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((AttachmentsResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((AttachmentsResponse)o).setValue(n.getCollectionOfObjectValues(Attachment::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((AttachmentsResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((AttachmentsResponse)o).setValue(n.getCollectionOfObjectValues(Attachment.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java index 93b6976fd..04ac6424c 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.attachments.item; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.attachments.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Attachment; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/attachments/{attachment-id} */ -public class AttachmentRequestBuilder { +public class AttachmentItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class AttachmentRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new AttachmentRequestBuilder and sets the default values. + * Instantiates a new AttachmentItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public AttachmentRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -36,12 +37,12 @@ public AttachmentRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsRequestBuilder.java index 2d62710f0..f0d7cce8e 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.extensions; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Extension; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsResponse.java index c03a860a1..48b035fc6 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/ExtensionsResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.extensions; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class ExtensionsResponse implements Parsable { public ExtensionsResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a extensionsResponse + */ + @javax.annotation.Nonnull + public static ExtensionsResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new ExtensionsResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public ExtensionsResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((ExtensionsResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((ExtensionsResponse)o).setValue(n.getCollectionOfObjectValues(Extension::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((ExtensionsResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((ExtensionsResponse)o).setValue(n.getCollectionOfObjectValues(Extension.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java index 9b6a9242d..7810fda3d 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.extensions.item; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.extensions.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Extension; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/extensions/{extension-id} */ -public class ExtensionRequestBuilder { +public class ExtensionItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class ExtensionRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new ExtensionRequestBuilder and sets the default values. + * Instantiates a new ExtensionItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public ExtensionRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -36,12 +37,12 @@ public ExtensionRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java index abf28333d..8dd8911a8 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.multivalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java index 957cccf8a..4f16fda92 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.multivalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MultiValueExtendedPropertiesResponse implements Parsable { public MultiValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a multiValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static MultiValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MultiValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MultiValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 92% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java index 987895002..6ec498cfa 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.multivalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -public class MultiValueLegacyExtendedPropertyRequestBuilder { +public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java index 3651bd5f7..ef5fb3cd4 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.singlevalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java index 22e4c5776..3249e56ac 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.singlevalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class SingleValueExtendedPropertiesResponse implements Parsable { public SingleValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a singleValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static SingleValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new SingleValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public SingleValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 92% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java index d0042fb72..bafe467a9 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.singlevalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -public class SingleValueLegacyExtendedPropertyRequestBuilder { +public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/value/ContentRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/value/ContentRequestBuilder.java index a4e781f07..c24d394f7 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/value/ContentRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/messages/item/value/ContentRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.messages.item.value; +package graphjavav4.utilities.users.item.mailfolders.item.messages.item.value; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.RequestAdapter; @@ -6,6 +6,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import java.io.InputStream; import java.net.URISyntaxException; import java.util.Collection; @@ -135,7 +136,7 @@ public RequestInformation createPutRequestInformation(final InputStream body, @j public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -148,7 +149,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -162,7 +163,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -177,7 +178,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -190,7 +191,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture put(final InputStream body) { try { final RequestInformation requestInfo = createPutRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -204,7 +205,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body) public java.util.concurrent.CompletableFuture put(final InputStream body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPutRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -219,7 +220,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body, public java.util.concurrent.CompletableFuture put(final InputStream body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPutRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -236,7 +237,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body, Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPutRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java index ed5c86324..e70e275a1 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.multivalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java index 594cacd4f..1da32b493 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.multivalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MultiValueExtendedPropertiesResponse implements Parsable { public MultiValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a multiValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static MultiValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MultiValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MultiValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 93% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java index 55c02bb97..ac31a2d7b 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.multiValueExtendedProperties.item; +package graphjavav4.utilities.users.item.mailfolders.item.multivalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -public class MultiValueLegacyExtendedPropertyRequestBuilder { +public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java index 6648e9ad1..0b5b916ec 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.singlevalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java index a68a3f96c..10865067b 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.mailfolders.item.singlevalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class SingleValueExtendedPropertiesResponse implements Parsable { public SingleValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a singleValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static SingleValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new SingleValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public SingleValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 92% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java index 8ed58b65c..717a4b7f1 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/mailFolders/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.mailFolders.item.singleValueExtendedProperties.item; +package graphjavav4.utilities.users.item.mailfolders.item.singlevalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -public class SingleValueLegacyExtendedPropertyRequestBuilder { +public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesRequestBuilder.java index 405893359..810e04bcc 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesRequestBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Message; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MessagesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MessagesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annot public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.No Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesResponse.java index 482520e45..ec8440ad6 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/MessagesResponse.java @@ -20,6 +20,16 @@ public class MessagesResponse implements Parsable { public MessagesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a messagesResponse + */ + @javax.annotation.Nonnull + public static MessagesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MessagesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MessagesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MessagesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MessagesResponse)o).setValue(n.getCollectionOfObjectValues(Message::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MessagesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MessagesResponse)o).setValue(n.getCollectionOfObjectValues(Message.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageItemRequestBuilder.java similarity index 88% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageItemRequestBuilder.java index 0d8fcf085..97f72f3dd 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/MessageItemRequestBuilder.java @@ -7,15 +7,16 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Message; import graphjavav4.utilities.users.item.messages.item.attachments.AttachmentsRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.attachments.item.AttachmentRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.attachments.item.AttachmentItemRequestBuilder; import graphjavav4.utilities.users.item.messages.item.extensions.ExtensionsRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.extensions.item.ExtensionRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties.item.MultiValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties.MultiValueExtendedPropertiesRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties.item.SingleValueLegacyExtendedPropertyRequestBuilder; -import graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties.SingleValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.extensions.item.ExtensionItemRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.multivalueextendedproperties.item.MultiValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.multivalueextendedproperties.MultiValueExtendedPropertiesRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.singlevalueextendedproperties.item.SingleValueLegacyExtendedPropertyItemRequestBuilder; +import graphjavav4.utilities.users.item.messages.item.singlevalueextendedproperties.SingleValueExtendedPropertiesRequestBuilder; import graphjavav4.utilities.users.item.messages.item.value.ContentRequestBuilder; import java.net.URISyntaxException; import java.util.Collection; @@ -23,7 +24,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id} */ -public class MessageRequestBuilder { +public class MessageItemRequestBuilder { @javax.annotation.Nonnull public AttachmentsRequestBuilder attachments() { return new AttachmentsRequestBuilder(pathParameters, requestAdapter); @@ -53,22 +54,22 @@ public SingleValueExtendedPropertiesRequestBuilder singleValueExtendedProperties /** * Gets an item from the graphjavav4.utilities.users.item.messages.item.attachments.item collection * @param id Unique identifier of the item - * @return a attachmentRequestBuilder + * @return a attachmentItemRequestBuilder */ @javax.annotation.Nonnull - public AttachmentRequestBuilder attachments(@javax.annotation.Nonnull final String id) { + public AttachmentItemRequestBuilder attachments(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("attachment_id", id); - return new AttachmentRequestBuilder(urlTplParams, requestAdapter); + return new AttachmentItemRequestBuilder(urlTplParams, requestAdapter); } /** - * Instantiates a new MessageRequestBuilder and sets the default values. + * Instantiates a new MessageItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MessageRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MessageItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}{?select}"; @@ -77,12 +78,12 @@ public MessageRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -231,7 +232,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -258,7 +259,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -273,7 +274,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -281,14 +282,14 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul /** * Gets an item from the graphjavav4.utilities.users.item.messages.item.extensions.item collection * @param id Unique identifier of the item - * @return a extensionRequestBuilder + * @return a extensionItemRequestBuilder */ @javax.annotation.Nonnull - public ExtensionRequestBuilder extensions(@javax.annotation.Nonnull final String id) { + public ExtensionItemRequestBuilder extensions(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("extension_id", id); - return new ExtensionRequestBuilder(urlTplParams, requestAdapter); + return new ExtensionItemRequestBuilder(urlTplParams, requestAdapter); } /** * The messages in a mailbox or folder. Read-only. Nullable. @@ -297,7 +298,7 @@ public ExtensionRequestBuilder extensions(@javax.annotation.Nonnull final String public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -310,7 +311,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -324,7 +325,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -339,7 +340,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, null); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -355,7 +356,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Message.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Message::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -363,14 +364,14 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nul /** * Gets an item from the graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a multiValueLegacyExtendedPropertyRequestBuilder + * @return a multiValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder multiValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** * The messages in a mailbox or folder. Read-only. Nullable. @@ -380,7 +381,7 @@ public MultiValueLegacyExtendedPropertyRequestBuilder multiValueExtendedProperti public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -394,7 +395,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -409,7 +410,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Message body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -426,7 +427,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -434,14 +435,14 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn /** * Gets an item from the graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @return a singleValueLegacyExtendedPropertyRequestBuilder + * @return a singleValueLegacyExtendedPropertyItemRequestBuilder */ @javax.annotation.Nonnull - public SingleValueLegacyExtendedPropertyRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder singleValueExtendedProperties(@javax.annotation.Nonnull final String id) { Objects.requireNonNull(id); var urlTplParams = new HashMap(this.pathParameters); urlTplParams.put("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, requestAdapter); + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, requestAdapter); } /** The messages in a mailbox or folder. Read-only. Nullable. */ public class GetQueryParameters extends QueryParametersBase { diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsRequestBuilder.java index d04f2acdb..b28b33e76 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsRequestBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Attachment; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, AttachmentsResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.an public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsResponse.java index 5d56fdd5a..3444dca3f 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/AttachmentsResponse.java @@ -20,6 +20,16 @@ public class AttachmentsResponse implements Parsable { public AttachmentsResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a attachmentsResponse + */ + @javax.annotation.Nonnull + public static AttachmentsResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new AttachmentsResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public AttachmentsResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((AttachmentsResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((AttachmentsResponse)o).setValue(n.getCollectionOfObjectValues(Attachment::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((AttachmentsResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((AttachmentsResponse)o).setValue(n.getCollectionOfObjectValues(Attachment.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java similarity index 94% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java index 5fa55cb2e..3b845b6a4 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/attachments/item/AttachmentItemRequestBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Attachment; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/attachments/{attachment-id} */ -public class AttachmentRequestBuilder { +public class AttachmentItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class AttachmentRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new AttachmentRequestBuilder and sets the default values. + * Instantiates a new AttachmentItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public AttachmentRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public AttachmentItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -36,12 +37,12 @@ public AttachmentRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, null); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Attachment.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Attachment::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation. public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Attachment body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsRequestBuilder.java index 57312144a..d9206f01c 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsRequestBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Extension; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, ExtensionsResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture get(@javax.ann public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation. Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsResponse.java index f980d963f..223227752 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/ExtensionsResponse.java @@ -20,6 +20,16 @@ public class ExtensionsResponse implements Parsable { public ExtensionsResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a extensionsResponse + */ + @javax.annotation.Nonnull + public static ExtensionsResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new ExtensionsResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public ExtensionsResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((ExtensionsResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((ExtensionsResponse)o).setValue(n.getCollectionOfObjectValues(Extension::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((ExtensionsResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((ExtensionsResponse)o).setValue(n.getCollectionOfObjectValues(Extension.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java similarity index 94% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java index 27a49948d..6957ee226 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/extensions/item/ExtensionItemRequestBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.Extension; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/extensions/{extension-id} */ -public class ExtensionRequestBuilder { +public class ExtensionItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class ExtensionRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new ExtensionRequestBuilder and sets the default values. + * Instantiates a new ExtensionItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public ExtensionRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public ExtensionItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -36,12 +37,12 @@ public ExtensionRequestBuilder(@javax.annotation.Nonnull final HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, null); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, Extension.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, Extension::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.N public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final Extension body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java index 2d3274711..ce313e5e3 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.messages.item.multivalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java index 0eb53efe7..7e53618f1 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/MultiValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties; +package graphjavav4.utilities.users.item.messages.item.multivalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class MultiValueExtendedPropertiesResponse implements Parsable { public MultiValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a multiValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static MultiValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new MultiValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public MultiValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((MultiValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 92% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java index 2a0b8d26d..6a60cabd0 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/multiValueExtendedProperties/item/MultiValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.multiValueExtendedProperties.item; +package graphjavav4.utilities.users.item.messages.item.multivalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.MultiValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -public class MultiValueLegacyExtendedPropertyRequestBuilder { +public class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class MultiValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public MultiValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public MultiValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, MultiValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final MultiValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java index 102c9dbd2..6af32e574 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.messages.item.singlevalueextendedproperties; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -152,7 +153,7 @@ public RequestInformation createPostRequestInformation(@javax.annotation.Nonnull public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -165,7 +166,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -179,7 +180,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -194,7 +195,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -210,7 +211,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -223,7 +224,7 @@ public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPostRequestInformation(body, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -237,7 +238,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -252,7 +253,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture post(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -269,7 +270,7 @@ public java.util.concurrent.CompletableFuture Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPostRequestInformation(body, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java index 584e596d8..cf2cabdeb 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/SingleValueExtendedPropertiesResponse.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties; +package graphjavav4.utilities.users.item.messages.item.singlevalueextendedproperties; import com.microsoft.kiota.serialization.Parsable; import com.microsoft.kiota.serialization.ParseNode; @@ -20,6 +20,16 @@ public class SingleValueExtendedPropertiesResponse implements Parsable { public SingleValueExtendedPropertiesResponse() { this.setAdditionalData(new HashMap<>()); } + /** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @return a singleValueExtendedPropertiesResponse + */ + @javax.annotation.Nonnull + public static SingleValueExtendedPropertiesResponse createFromDiscriminatorValue(@javax.annotation.Nonnull final ParseNode parseNode) { + Objects.requireNonNull(parseNode); + return new SingleValueExtendedPropertiesResponse(); + } /** * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return a Map @@ -28,6 +38,17 @@ public SingleValueExtendedPropertiesResponse() { public Map getAdditionalData() { return this._additionalData; } + /** + * The deserialization information for the current model + * @return a Map> + */ + @javax.annotation.Nonnull + public Map> getFieldDeserializers() { + return new HashMap<>(2) {{ + this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); + this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty::createFromDiscriminatorValue)); }); + }}; + } /** * Gets the @odata.nextLink property value. * @return a string @@ -44,17 +65,6 @@ public String getNextLink() { public java.util.List getValue() { return this._value; } - /** - * The deserialization information for the current model - * @return a Map> - */ - @javax.annotation.Nonnull - public Map> getFieldDeserializers() { - return new HashMap<>(2) {{ - this.put("@odata.nextLink", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setNextLink(n.getStringValue()); }); - this.put("value", (o, n) -> { ((SingleValueExtendedPropertiesResponse)o).setValue(n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty.class)); }); - }}; - } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java similarity index 92% rename from msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java rename to msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java index 79b3aa1c4..0f572abbe 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/singleValueExtendedProperties/item/SingleValueLegacyExtendedPropertyItemRequestBuilder.java @@ -1,4 +1,4 @@ -package graphjavav4.utilities.users.item.messages.item.singleValueExtendedProperties.item; +package graphjavav4.utilities.users.item.messages.item.singlevalueextendedproperties.item; import com.microsoft.kiota.HttpMethod; import com.microsoft.kiota.QueryParametersBase; @@ -7,6 +7,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import graphjavav4.utilities.models.microsoft.graph.SingleValueLegacyExtendedProperty; import java.net.URISyntaxException; import java.util.Collection; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.Objects; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -public class SingleValueLegacyExtendedPropertyRequestBuilder { +public class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ private final HashMap pathParameters; /** The request adapter to use to execute the requests. */ @@ -22,12 +23,12 @@ public class SingleValueLegacyExtendedPropertyRequestBuilder { /** Url template to use to build the URL for the current request builder */ private final String urlTemplate; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters Path parameters for the request * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final HashMap pathParameters, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { Objects.requireNonNull(pathParameters); Objects.requireNonNull(requestAdapter); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -36,12 +37,12 @@ public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull this.requestAdapter = requestAdapter; } /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param rawUrl The raw URL to use for the request builder. * @param requestAdapter The request adapter to use to execute the requests. * @return a void */ - public SingleValueLegacyExtendedPropertyRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { + public SingleValueLegacyExtendedPropertyItemRequestBuilder(@javax.annotation.Nonnull final String rawUrl, @javax.annotation.Nonnull final RequestAdapter requestAdapter) { this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; var urlTplParams = new HashMap(); urlTplParams.put("request-raw-url", rawUrl); @@ -190,7 +191,7 @@ public RequestInformation createPatchRequestInformation(@javax.annotation.Nonnul public java.util.concurrent.CompletableFuture delete() { try { final RequestInformation requestInfo = createDeleteRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -203,7 +204,7 @@ public java.util.concurrent.CompletableFuture delete() { public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -217,7 +218,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -232,7 +233,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createDeleteRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -244,7 +245,7 @@ public java.util.concurrent.CompletableFuture delete(@javax.annotation.Nul public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -257,7 +258,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q) { try { final RequestInformation requestInfo = createGetRequestInformation(q, null, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -271,7 +272,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, null); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -286,7 +287,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, null); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -302,7 +303,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer q, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(q, h, o); - return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty.class, responseHandler); + return this.requestAdapter.sendAsync(requestInfo, SingleValueLegacyExtendedProperty::createFromDiscriminatorValue, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -315,7 +316,7 @@ public java.util.concurrent.CompletableFuture public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -329,7 +330,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -344,7 +345,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonnull final SingleValueLegacyExtendedProperty body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -361,7 +362,7 @@ public java.util.concurrent.CompletableFuture patch(@javax.annotation.Nonn Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPatchRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/value/ContentRequestBuilder.java b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/value/ContentRequestBuilder.java index 0a20c4d83..47de80a49 100644 --- a/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/value/ContentRequestBuilder.java +++ b/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities/users/item/messages/item/value/ContentRequestBuilder.java @@ -6,6 +6,7 @@ import com.microsoft.kiota.RequestOption; import com.microsoft.kiota.ResponseHandler; import com.microsoft.kiota.serialization.Parsable; +import com.microsoft.kiota.serialization.ParsableFactory; import java.io.InputStream; import java.net.URISyntaxException; import java.util.Collection; @@ -135,7 +136,7 @@ public RequestInformation createPutRequestInformation(final InputStream body, @j public java.util.concurrent.CompletableFuture get() { try { final RequestInformation requestInfo = createGetRequestInformation(null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -148,7 +149,7 @@ public java.util.concurrent.CompletableFuture get() { public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createGetRequestInformation(h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -162,7 +163,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createGetRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -177,7 +178,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture get(@javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o, @javax.annotation.Nullable final ResponseHandler responseHandler) { try { final RequestInformation requestInfo = createGetRequestInformation(h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, InputStream.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -190,7 +191,7 @@ public java.util.concurrent.CompletableFuture get(@javax.annotation public java.util.concurrent.CompletableFuture put(final InputStream body) { try { final RequestInformation requestInfo = createPutRequestInformation(body, null, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -204,7 +205,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body) public java.util.concurrent.CompletableFuture put(final InputStream body, @javax.annotation.Nullable final java.util.function.Consumer> h) { try { final RequestInformation requestInfo = createPutRequestInformation(body, h, null); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -219,7 +220,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body, public java.util.concurrent.CompletableFuture put(final InputStream body, @javax.annotation.Nullable final java.util.function.Consumer> h, @javax.annotation.Nullable final Collection o) { try { final RequestInformation requestInfo = createPutRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, null, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } @@ -236,7 +237,7 @@ public java.util.concurrent.CompletableFuture put(final InputStream body, Objects.requireNonNull(body); try { final RequestInformation requestInfo = createPutRequestInformation(body, h, o); - return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler); + return this.requestAdapter.sendPrimitiveAsync(requestInfo, Void.class, responseHandler, null); } catch (URISyntaxException ex) { return java.util.concurrent.CompletableFuture.failedFuture(ex); } diff --git a/msgraph-mail/typescript/src/apiClient.ts b/msgraph-mail/typescript/src/apiClient.ts index dbf4f8597..ed42289c7 100644 --- a/msgraph-mail/typescript/src/apiClient.ts +++ b/msgraph-mail/typescript/src/apiClient.ts @@ -1,4 +1,4 @@ -import {UserRequestBuilder} from './users/item/userRequestBuilder'; +import {UserItemRequestBuilder} from './users/item/userItemRequestBuilder'; import {UsersRequestBuilder} from './users/usersRequestBuilder'; import {enableBackingStoreForSerializationWriterFactory, getPathParameters, ParseNodeFactoryRegistry, registerDefaultDeserializer, registerDefaultSerializer, RequestAdapter, SerializationWriterFactoryRegistry} from '@microsoft/kiota-abstractions'; import {JsonParseNodeFactory, JsonSerializationWriterFactory} from '@microsoft/kiota-serialization-json'; @@ -6,7 +6,7 @@ import {JsonParseNodeFactory, JsonSerializationWriterFactory} from '@microsoft/k /** The main entry point of the SDK, exposes the configuration and the fluent API. */ export class ApiClient { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -20,7 +20,7 @@ export class ApiClient { */ public constructor(requestAdapter: RequestAdapter) { if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); - this.pathParameters = new Map(); + this.pathParameters = {}; this.urlTemplate = "{+baseurl}"; this.requestAdapter = requestAdapter; registerDefaultSerializer(JsonSerializationWriterFactory); @@ -30,12 +30,12 @@ export class ApiClient { /** * Gets an item from the graphtypescriptv4.utilities.users.item collection * @param id Unique identifier of the item - * @returns a userRequestBuilder + * @returns a userItemRequestBuilder */ - public usersById(id: string) : UserRequestBuilder { + public usersById(id: string) : UserItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("user_id", id); - return new UserRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["user_id"] = id + return new UserItemRequestBuilder(urlTplParams, this.requestAdapter); }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/attachment.ts b/msgraph-mail/typescript/src/models/microsoft/graph/attachment.ts index 593cbde2d..db92f8d67 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/attachment.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/attachment.ts @@ -26,32 +26,11 @@ export class Attachment extends Entity implements Parsable { return this._contentType; }; /** - * Gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. - * @returns a boolean - */ - public get isInline() { - return this._isInline; - }; - /** - * Gets the lastModifiedDateTime property value. 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 - * @returns a Date - */ - public get lastModifiedDateTime() { - return this._lastModifiedDateTime; - }; - /** - * Gets the name property value. The attachment's file name. - * @returns a string - */ - public get name() { - return this._name; - }; - /** - * Gets the size property value. The length of the attachment in bytes. - * @returns a integer + * Sets the contentType property value. The MIME type. + * @param value Value to set for the contentType property. */ - public get size() { - return this._size; + public set contentType(value: string | undefined) { + this._contentType = value; }; /** * The deserialization information for the current model @@ -67,24 +46,11 @@ export class Attachment extends Entity implements Parsable { ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - super.serialize(writer); - writer.writeStringValue("contentType", this.contentType); - writer.writeBooleanValue("isInline", this.isInline); - writer.writeDateValue("lastModifiedDateTime", this.lastModifiedDateTime); - writer.writeStringValue("name", this.name); - writer.writeNumberValue("size", this.size); - }; - /** - * Sets the contentType property value. The MIME type. - * @param value Value to set for the contentType property. + * Gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. + * @returns a boolean */ - public set contentType(value: string | undefined) { - this._contentType = value; + public get isInline() { + return this._isInline; }; /** * Sets the isInline property value. true if the attachment is an inline attachment; otherwise, false. @@ -93,6 +59,13 @@ export class Attachment extends Entity implements Parsable { public set isInline(value: boolean | undefined) { this._isInline = value; }; + /** + * Gets the lastModifiedDateTime property value. 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 + * @returns a Date + */ + public get lastModifiedDateTime() { + return this._lastModifiedDateTime; + }; /** * Sets the lastModifiedDateTime property value. 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 * @param value Value to set for the lastModifiedDateTime property. @@ -100,6 +73,13 @@ export class Attachment extends Entity implements Parsable { public set lastModifiedDateTime(value: Date | undefined) { this._lastModifiedDateTime = value; }; + /** + * Gets the name property value. The attachment's file name. + * @returns a string + */ + public get name() { + return this._name; + }; /** * Sets the name property value. The attachment's file name. * @param value Value to set for the name property. @@ -107,6 +87,26 @@ export class Attachment extends Entity implements Parsable { public set name(value: string | undefined) { this._name = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + super.serialize(writer); + writer.writeStringValue("contentType", this.contentType); + writer.writeBooleanValue("isInline", this.isInline); + writer.writeDateValue("lastModifiedDateTime", this.lastModifiedDateTime); + writer.writeStringValue("name", this.name); + writer.writeNumberValue("size", this.size); + }; + /** + * Gets the size property value. The length of the attachment in bytes. + * @returns a integer + */ + public get size() { + return this._size; + }; /** * Sets the size property value. The length of the attachment in bytes. * @param value Value to set for the size property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createAttachmentFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createAttachmentFromDiscriminatorValue.ts new file mode 100644 index 000000000..4dba0bdb7 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createAttachmentFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {Attachment} from './attachment'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createAttachmentFromDiscriminatorValue(parseNode: ParseNode | undefined) : Attachment { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new Attachment(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createDateTimeTimeZoneFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createDateTimeTimeZoneFromDiscriminatorValue.ts new file mode 100644 index 000000000..5f635da9e --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createDateTimeTimeZoneFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {DateTimeTimeZone} from './dateTimeTimeZone'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createDateTimeTimeZoneFromDiscriminatorValue(parseNode: ParseNode | undefined) : DateTimeTimeZone { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new DateTimeTimeZone(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createEmailAddressFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createEmailAddressFromDiscriminatorValue.ts new file mode 100644 index 000000000..52c1dd86f --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createEmailAddressFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {EmailAddress} from './emailAddress'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createEmailAddressFromDiscriminatorValue(parseNode: ParseNode | undefined) : EmailAddress { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new EmailAddress(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createEntityFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createEntityFromDiscriminatorValue.ts new file mode 100644 index 000000000..30f1f151e --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createEntityFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {Entity} from './entity'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createEntityFromDiscriminatorValue(parseNode: ParseNode | undefined) : Entity { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new Entity(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createExtensionFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createExtensionFromDiscriminatorValue.ts new file mode 100644 index 000000000..9894a24c0 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createExtensionFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {Extension} from './extension'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createExtensionFromDiscriminatorValue(parseNode: ParseNode | undefined) : Extension { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new Extension(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createFollowupFlagFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createFollowupFlagFromDiscriminatorValue.ts new file mode 100644 index 000000000..1643a78fc --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createFollowupFlagFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {FollowupFlag} from './followupFlag'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createFollowupFlagFromDiscriminatorValue(parseNode: ParseNode | undefined) : FollowupFlag { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new FollowupFlag(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationFromDiscriminatorValue.ts new file mode 100644 index 000000000..388c0bf68 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {InferenceClassification} from './inferenceClassification'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createInferenceClassificationFromDiscriminatorValue(parseNode: ParseNode | undefined) : InferenceClassification { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new InferenceClassification(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue.ts new file mode 100644 index 000000000..b3891f247 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {InferenceClassificationOverride} from './inferenceClassificationOverride'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createInferenceClassificationOverrideFromDiscriminatorValue(parseNode: ParseNode | undefined) : InferenceClassificationOverride { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new InferenceClassificationOverride(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createInternetMessageHeaderFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createInternetMessageHeaderFromDiscriminatorValue.ts new file mode 100644 index 000000000..6b019ca4e --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createInternetMessageHeaderFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {InternetMessageHeader} from './internetMessageHeader'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createInternetMessageHeaderFromDiscriminatorValue(parseNode: ParseNode | undefined) : InternetMessageHeader { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new InternetMessageHeader(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createItemBodyFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createItemBodyFromDiscriminatorValue.ts new file mode 100644 index 000000000..d427c0606 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createItemBodyFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {ItemBody} from './itemBody'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createItemBodyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ItemBody { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new ItemBody(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMailFolderFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMailFolderFromDiscriminatorValue.ts new file mode 100644 index 000000000..6dc855f9b --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMailFolderFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MailFolder} from './mailFolder'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMailFolderFromDiscriminatorValue(parseNode: ParseNode | undefined) : MailFolder { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MailFolder(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMessageFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageFromDiscriminatorValue.ts new file mode 100644 index 000000000..95a0b22e1 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {Message} from './message'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessageFromDiscriminatorValue(parseNode: ParseNode | undefined) : Message { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new Message(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleActionsFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleActionsFromDiscriminatorValue.ts new file mode 100644 index 000000000..e4e383b86 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleActionsFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessageRuleActions} from './messageRuleActions'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessageRuleActionsFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessageRuleActions { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessageRuleActions(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleFromDiscriminatorValue.ts new file mode 100644 index 000000000..e4a36731d --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRuleFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessageRule} from './messageRule'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessageRuleFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessageRule { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessageRule(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRulePredicatesFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRulePredicatesFromDiscriminatorValue.ts new file mode 100644 index 000000000..653dc6a10 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMessageRulePredicatesFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessageRulePredicates} from './messageRulePredicates'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessageRulePredicatesFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessageRulePredicates { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessageRulePredicates(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue.ts new file mode 100644 index 000000000..534aa93ed --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MultiValueLegacyExtendedProperty} from './multiValueLegacyExtendedProperty'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMultiValueLegacyExtendedPropertyFromDiscriminatorValue(parseNode: ParseNode | undefined) : MultiValueLegacyExtendedProperty { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MultiValueLegacyExtendedProperty(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createOutlookItemFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createOutlookItemFromDiscriminatorValue.ts new file mode 100644 index 000000000..0435f1bf6 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createOutlookItemFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {OutlookItem} from './outlookItem'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createOutlookItemFromDiscriminatorValue(parseNode: ParseNode | undefined) : OutlookItem { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new OutlookItem(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createRecipientFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createRecipientFromDiscriminatorValue.ts new file mode 100644 index 000000000..da3c74df0 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createRecipientFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {Recipient} from './recipient'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createRecipientFromDiscriminatorValue(parseNode: ParseNode | undefined) : Recipient { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new Recipient(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue.ts new file mode 100644 index 000000000..0fd24c138 --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {SingleValueLegacyExtendedProperty} from './singleValueLegacyExtendedProperty'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createSingleValueLegacyExtendedPropertyFromDiscriminatorValue(parseNode: ParseNode | undefined) : SingleValueLegacyExtendedProperty { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new SingleValueLegacyExtendedProperty(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/createSizeRangeFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/models/microsoft/graph/createSizeRangeFromDiscriminatorValue.ts new file mode 100644 index 000000000..c5e0e460e --- /dev/null +++ b/msgraph-mail/typescript/src/models/microsoft/graph/createSizeRangeFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {SizeRange} from './sizeRange'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createSizeRangeFromDiscriminatorValue(parseNode: ParseNode | undefined) : SizeRange { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new SizeRange(); +} diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/dateTimeTimeZone.ts b/msgraph-mail/typescript/src/models/microsoft/graph/dateTimeTimeZone.ts index f84a14135..d7e7ac5e6 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/dateTimeTimeZone.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/dateTimeTimeZone.ts @@ -8,18 +8,25 @@ export class DateTimeTimeZone implements Parsable { /** Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. */ private _timeZone?: string | undefined; /** - * Instantiates a new dateTimeTimeZone and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; + /** + * Instantiates a new dateTimeTimeZone and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); + }; /** * Gets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). * @returns a string @@ -28,11 +35,11 @@ export class DateTimeTimeZone implements Parsable { return this._dateTime; }; /** - * Gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. - * @returns a string + * Sets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). + * @param value Value to set for the dateTime property. */ - public get timeZone() { - return this._timeZone; + public set dateTime(value: string | undefined) { + this._dateTime = value; }; /** * The deserialization information for the current model @@ -55,18 +62,11 @@ export class DateTimeTimeZone implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the dateTime property value. A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000). - * @param value Value to set for the dateTime property. + * Gets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. + * @returns a string */ - public set dateTime(value: string | undefined) { - this._dateTime = value; + public get timeZone() { + return this._timeZone; }; /** * Sets the timeZone property value. Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/emailAddress.ts b/msgraph-mail/typescript/src/models/microsoft/graph/emailAddress.ts index e29ca38c2..a079b9125 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/emailAddress.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/emailAddress.ts @@ -8,18 +8,19 @@ export class EmailAddress implements Parsable { /** The display name of the person or entity. */ private _name?: string | undefined; /** - * Instantiates a new emailAddress and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; /** * Gets the address property value. The email address of the person or entity. * @returns a string @@ -28,11 +29,17 @@ export class EmailAddress implements Parsable { return this._address; }; /** - * Gets the name property value. The display name of the person or entity. - * @returns a string + * Sets the address property value. The email address of the person or entity. + * @param value Value to set for the address property. */ - public get name() { - return this._name; + public set address(value: string | undefined) { + this._address = value; + }; + /** + * Instantiates a new emailAddress and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -45,28 +52,11 @@ export class EmailAddress implements Parsable { ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - writer.writeStringValue("address", this.address); - writer.writeStringValue("name", this.name); - writer.writeAdditionalData(this.additionalData); - }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the address property value. The email address of the person or entity. - * @param value Value to set for the address property. + * Gets the name property value. The display name of the person or entity. + * @returns a string */ - public set address(value: string | undefined) { - this._address = value; + public get name() { + return this._name; }; /** * Sets the name property value. The display name of the person or entity. @@ -75,4 +65,14 @@ export class EmailAddress implements Parsable { public set name(value: string | undefined) { this._name = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + writer.writeStringValue("address", this.address); + writer.writeStringValue("name", this.name); + writer.writeAdditionalData(this.additionalData); + }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/entity.ts b/msgraph-mail/typescript/src/models/microsoft/graph/entity.ts index 0f16d69b8..df26dbc96 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/entity.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/entity.ts @@ -6,24 +6,24 @@ export class Entity implements Parsable { /** Read-only. */ private _id?: string | undefined; /** - * Instantiates a new entity and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the id property value. Read-only. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get id() { - return this._id; + public set additionalData(value: Map) { + this._additionalData = value; + }; + /** + * Instantiates a new entity and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -35,20 +35,11 @@ export class Entity implements Parsable { ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - writer.writeStringValue("id", this.id); - writer.writeAdditionalData(this.additionalData); - }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. + * Gets the id property value. Read-only. + * @returns a string */ - public set additionalData(value: Map) { - this._additionalData = value; + public get id() { + return this._id; }; /** * Sets the id property value. Read-only. @@ -57,4 +48,13 @@ export class Entity implements Parsable { public set id(value: string | undefined) { this._id = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + writer.writeStringValue("id", this.id); + writer.writeAdditionalData(this.additionalData); + }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/followupFlag.ts b/msgraph-mail/typescript/src/models/microsoft/graph/followupFlag.ts index 1d4ffc110..9cd047f71 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/followupFlag.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/followupFlag.ts @@ -1,3 +1,4 @@ +import {createDateTimeTimeZoneFromDiscriminatorValue} from './createDateTimeTimeZoneFromDiscriminatorValue'; import {DateTimeTimeZone} from './dateTimeTimeZone'; import {FollowupFlagStatus} from './followupFlagStatus'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -10,18 +11,19 @@ export class FollowupFlag implements Parsable { private _flagStatus?: FollowupFlagStatus | undefined; private _startDateTime?: DateTimeTimeZone | undefined; /** - * Instantiates a new followupFlag and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; /** * Gets the completedDateTime property value. * @returns a dateTimeTimeZone @@ -29,6 +31,19 @@ export class FollowupFlag implements Parsable { public get completedDateTime() { return this._completedDateTime; }; + /** + * Sets the completedDateTime property value. + * @param value Value to set for the completedDateTime property. + */ + public set completedDateTime(value: DateTimeTimeZone | undefined) { + this._completedDateTime = value; + }; + /** + * Instantiates a new followupFlag and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); + }; /** * Gets the dueDateTime property value. * @returns a dateTimeTimeZone @@ -36,6 +51,13 @@ export class FollowupFlag implements Parsable { public get dueDateTime() { return this._dueDateTime; }; + /** + * Sets the dueDateTime property value. + * @param value Value to set for the dueDateTime property. + */ + public set dueDateTime(value: DateTimeTimeZone | undefined) { + this._dueDateTime = value; + }; /** * Gets the flagStatus property value. * @returns a followupFlagStatus @@ -44,11 +66,11 @@ export class FollowupFlag implements Parsable { return this._flagStatus; }; /** - * Gets the startDateTime property value. - * @returns a dateTimeTimeZone + * Sets the flagStatus property value. + * @param value Value to set for the flagStatus property. */ - public get startDateTime() { - return this._startDateTime; + public set flagStatus(value: FollowupFlagStatus | undefined) { + this._flagStatus = value; }; /** * The deserialization information for the current model @@ -56,10 +78,10 @@ export class FollowupFlag implements Parsable { */ public getFieldDeserializers() : Map void> { return new Map void>([ - ["completedDateTime", (o, n) => { (o as unknown as FollowupFlag).completedDateTime = n.getObjectValue(DateTimeTimeZone); }], - ["dueDateTime", (o, n) => { (o as unknown as FollowupFlag).dueDateTime = n.getObjectValue(DateTimeTimeZone); }], + ["completedDateTime", (o, n) => { (o as unknown as FollowupFlag).completedDateTime = n.getObjectValue(createDateTimeTimeZoneFromDiscriminatorValue); }], + ["dueDateTime", (o, n) => { (o as unknown as FollowupFlag).dueDateTime = n.getObjectValue(createDateTimeTimeZoneFromDiscriminatorValue); }], ["flagStatus", (o, n) => { (o as unknown as FollowupFlag).flagStatus = n.getEnumValue(FollowupFlagStatus); }], - ["startDateTime", (o, n) => { (o as unknown as FollowupFlag).startDateTime = n.getObjectValue(DateTimeTimeZone); }], + ["startDateTime", (o, n) => { (o as unknown as FollowupFlag).startDateTime = n.getObjectValue(createDateTimeTimeZoneFromDiscriminatorValue); }], ]); }; /** @@ -75,32 +97,11 @@ export class FollowupFlag implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the completedDateTime property value. - * @param value Value to set for the completedDateTime property. - */ - public set completedDateTime(value: DateTimeTimeZone | undefined) { - this._completedDateTime = value; - }; - /** - * Sets the dueDateTime property value. - * @param value Value to set for the dueDateTime property. - */ - public set dueDateTime(value: DateTimeTimeZone | undefined) { - this._dueDateTime = value; - }; - /** - * Sets the flagStatus property value. - * @param value Value to set for the flagStatus property. + * Gets the startDateTime property value. + * @returns a dateTimeTimeZone */ - public set flagStatus(value: FollowupFlagStatus | undefined) { - this._flagStatus = value; + public get startDateTime() { + return this._startDateTime; }; /** * Sets the startDateTime property value. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassification.ts b/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassification.ts index abc2399c0..da92cf169 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassification.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassification.ts @@ -1,3 +1,4 @@ +import {createInferenceClassificationOverrideFromDiscriminatorValue} from './createInferenceClassificationOverrideFromDiscriminatorValue'; import {Entity} from './entity'; import {InferenceClassificationOverride} from './inferenceClassificationOverride'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -11,6 +12,15 @@ export class InferenceClassification extends Entity implements Parsable { public constructor() { super(); }; + /** + * The deserialization information for the current model + * @returns a Map void> + */ + public getFieldDeserializers() : Map void> { + return new Map void>([...super.getFieldDeserializers(), + ["overrides", (o, n) => { (o as unknown as InferenceClassification).overrides = n.getCollectionOfObjectValues(createInferenceClassificationOverrideFromDiscriminatorValue); }], + ]); + }; /** * Gets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. * @returns a inferenceClassificationOverride @@ -19,13 +29,11 @@ export class InferenceClassification extends Entity implements Parsable { return this._overrides; }; /** - * The deserialization information for the current model - * @returns a Map void> + * Sets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. + * @param value Value to set for the overrides property. */ - public getFieldDeserializers() : Map void> { - return new Map void>([...super.getFieldDeserializers(), - ["overrides", (o, n) => { (o as unknown as InferenceClassification).overrides = n.getCollectionOfObjectValues(InferenceClassificationOverride); }], - ]); + public set overrides(value: InferenceClassificationOverride[] | undefined) { + this._overrides = value; }; /** * Serializes information the current object @@ -36,11 +44,4 @@ export class InferenceClassification extends Entity implements Parsable { super.serialize(writer); writer.writeCollectionOfObjectValues("overrides", this.overrides); }; - /** - * Sets the overrides property value. A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. - * @param value Value to set for the overrides property. - */ - public set overrides(value: InferenceClassificationOverride[] | undefined) { - this._overrides = value; - }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassificationOverride.ts b/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassificationOverride.ts index 68b4a6731..faa629ac7 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassificationOverride.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/inferenceClassificationOverride.ts @@ -1,3 +1,4 @@ +import {createEmailAddressFromDiscriminatorValue} from './createEmailAddressFromDiscriminatorValue'; import {EmailAddress} from './emailAddress'; import {Entity} from './entity'; import {InferenceClassificationType} from './inferenceClassificationType'; @@ -6,12 +7,6 @@ import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstrac export class InferenceClassificationOverride extends Entity implements Parsable { private _classifyAs?: InferenceClassificationType | undefined; private _senderEmailAddress?: EmailAddress | undefined; - /** - * Instantiates a new inferenceClassificationOverride and sets the default values. - */ - public constructor() { - super(); - }; /** * Gets the classifyAs property value. * @returns a inferenceClassificationType @@ -20,11 +15,17 @@ export class InferenceClassificationOverride extends Entity implements Parsable return this._classifyAs; }; /** - * Gets the senderEmailAddress property value. - * @returns a emailAddress + * Sets the classifyAs property value. + * @param value Value to set for the classifyAs property. */ - public get senderEmailAddress() { - return this._senderEmailAddress; + public set classifyAs(value: InferenceClassificationType | undefined) { + this._classifyAs = value; + }; + /** + * Instantiates a new inferenceClassificationOverride and sets the default values. + */ + public constructor() { + super(); }; /** * The deserialization information for the current model @@ -33,25 +34,15 @@ export class InferenceClassificationOverride extends Entity implements Parsable public getFieldDeserializers() : Map void> { return new Map void>([...super.getFieldDeserializers(), ["classifyAs", (o, n) => { (o as unknown as InferenceClassificationOverride).classifyAs = n.getEnumValue(InferenceClassificationType); }], - ["senderEmailAddress", (o, n) => { (o as unknown as InferenceClassificationOverride).senderEmailAddress = n.getObjectValue(EmailAddress); }], + ["senderEmailAddress", (o, n) => { (o as unknown as InferenceClassificationOverride).senderEmailAddress = n.getObjectValue(createEmailAddressFromDiscriminatorValue); }], ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - super.serialize(writer); - writer.writeEnumValue("classifyAs", this.classifyAs); - writer.writeObjectValue("senderEmailAddress", this.senderEmailAddress); - }; - /** - * Sets the classifyAs property value. - * @param value Value to set for the classifyAs property. + * Gets the senderEmailAddress property value. + * @returns a emailAddress */ - public set classifyAs(value: InferenceClassificationType | undefined) { - this._classifyAs = value; + public get senderEmailAddress() { + return this._senderEmailAddress; }; /** * Sets the senderEmailAddress property value. @@ -60,4 +51,14 @@ export class InferenceClassificationOverride extends Entity implements Parsable public set senderEmailAddress(value: EmailAddress | undefined) { this._senderEmailAddress = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + super.serialize(writer); + writer.writeEnumValue("classifyAs", this.classifyAs); + writer.writeObjectValue("senderEmailAddress", this.senderEmailAddress); + }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/internetMessageHeader.ts b/msgraph-mail/typescript/src/models/microsoft/graph/internetMessageHeader.ts index 5080e10a4..f1da13040 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/internetMessageHeader.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/internetMessageHeader.ts @@ -8,31 +8,24 @@ export class InternetMessageHeader implements Parsable { /** The value in a key-value pair. */ private _value?: string | undefined; /** - * Instantiates a new internetMessageHeader and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the name property value. Represents the key in a key-value pair. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get name() { - return this._name; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. The value in a key-value pair. - * @returns a string + * Instantiates a new internetMessageHeader and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -44,6 +37,20 @@ export class InternetMessageHeader implements Parsable { ["value", (o, n) => { (o as unknown as InternetMessageHeader).value = n.getStringValue(); }], ]); }; + /** + * Gets the name property value. Represents the key in a key-value pair. + * @returns a string + */ + public get name() { + return this._name; + }; + /** + * Sets the name property value. Represents the key in a key-value pair. + * @param value Value to set for the name property. + */ + public set name(value: string | undefined) { + this._name = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -55,18 +62,11 @@ export class InternetMessageHeader implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the name property value. Represents the key in a key-value pair. - * @param value Value to set for the name property. + * Gets the value property value. The value in a key-value pair. + * @returns a string */ - public set name(value: string | undefined) { - this._name = value; + public get value() { + return this._value; }; /** * Sets the value property value. The value in a key-value pair. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/itemBody.ts b/msgraph-mail/typescript/src/models/microsoft/graph/itemBody.ts index 53ab7c8c2..87369c77e 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/itemBody.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/itemBody.ts @@ -8,18 +8,25 @@ export class ItemBody implements Parsable { private _content?: string | undefined; private _contentType?: BodyType | undefined; /** - * Instantiates a new itemBody and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; + /** + * Instantiates a new itemBody and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); + }; /** * Gets the content property value. The content of the item. * @returns a string @@ -27,6 +34,13 @@ export class ItemBody implements Parsable { public get content() { return this._content; }; + /** + * Sets the content property value. The content of the item. + * @param value Value to set for the content property. + */ + public set content(value: string | undefined) { + this._content = value; + }; /** * Gets the contentType property value. * @returns a bodyType @@ -34,6 +48,13 @@ export class ItemBody implements Parsable { public get contentType() { return this._contentType; }; + /** + * Sets the contentType property value. + * @param value Value to set for the contentType property. + */ + public set contentType(value: BodyType | undefined) { + this._contentType = value; + }; /** * The deserialization information for the current model * @returns a Map void> @@ -54,25 +75,4 @@ export class ItemBody implements Parsable { writer.writeEnumValue("contentType", this.contentType); writer.writeAdditionalData(this.additionalData); }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the content property value. The content of the item. - * @param value Value to set for the content property. - */ - public set content(value: string | undefined) { - this._content = value; - }; - /** - * Sets the contentType property value. - * @param value Value to set for the contentType property. - */ - public set contentType(value: BodyType | undefined) { - this._contentType = value; - }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/mailFolder.ts b/msgraph-mail/typescript/src/models/microsoft/graph/mailFolder.ts index f1251d3d4..4371d687f 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/mailFolder.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/mailFolder.ts @@ -1,3 +1,8 @@ +import {createMailFolderFromDiscriminatorValue} from './createMailFolderFromDiscriminatorValue'; +import {createMessageFromDiscriminatorValue} from './createMessageFromDiscriminatorValue'; +import {createMessageRuleFromDiscriminatorValue} from './createMessageRuleFromDiscriminatorValue'; +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from './createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from './createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {Entity} from './entity'; import {Message} from './message'; import {MessageRule} from './messageRule'; @@ -28,12 +33,6 @@ export class MailFolder extends Entity implements Parsable { private _totalItemCount?: number | undefined; /** The number of items in the mailFolder marked as unread. */ private _unreadItemCount?: number | undefined; - /** - * Instantiates a new mailFolder and sets the default values. - */ - public constructor() { - super(); - }; /** * Gets the childFolderCount property value. The number of immediate child mailFolders in the current mailFolder. * @returns a integer @@ -41,6 +40,13 @@ export class MailFolder extends Entity implements Parsable { public get childFolderCount() { return this._childFolderCount; }; + /** + * Sets the childFolderCount property value. The number of immediate child mailFolders in the current mailFolder. + * @param value Value to set for the childFolderCount property. + */ + public set childFolderCount(value: number | undefined) { + this._childFolderCount = value; + }; /** * Gets the childFolders property value. The collection of child folders in the mailFolder. * @returns a mailFolder @@ -48,6 +54,19 @@ export class MailFolder extends Entity implements Parsable { public get childFolders() { return this._childFolders; }; + /** + * Sets the childFolders property value. The collection of child folders in the mailFolder. + * @param value Value to set for the childFolders property. + */ + public set childFolders(value: MailFolder[] | undefined) { + this._childFolders = value; + }; + /** + * Instantiates a new mailFolder and sets the default values. + */ + public constructor() { + super(); + }; /** * Gets the displayName property value. The mailFolder's display name. * @returns a string @@ -55,6 +74,32 @@ export class MailFolder extends Entity implements Parsable { public get displayName() { return this._displayName; }; + /** + * Sets the displayName property value. The mailFolder's display name. + * @param value Value to set for the displayName property. + */ + public set displayName(value: string | undefined) { + this._displayName = value; + }; + /** + * The deserialization information for the current model + * @returns a Map void> + */ + public getFieldDeserializers() : Map void> { + return new Map void>([...super.getFieldDeserializers(), + ["childFolderCount", (o, n) => { (o as unknown as MailFolder).childFolderCount = n.getNumberValue(); }], + ["childFolders", (o, n) => { (o as unknown as MailFolder).childFolders = n.getCollectionOfObjectValues(createMailFolderFromDiscriminatorValue); }], + ["displayName", (o, n) => { (o as unknown as MailFolder).displayName = n.getStringValue(); }], + ["isHidden", (o, n) => { (o as unknown as MailFolder).isHidden = n.getBooleanValue(); }], + ["messageRules", (o, n) => { (o as unknown as MailFolder).messageRules = n.getCollectionOfObjectValues(createMessageRuleFromDiscriminatorValue); }], + ["messages", (o, n) => { (o as unknown as MailFolder).messages = n.getCollectionOfObjectValues(createMessageFromDiscriminatorValue); }], + ["multiValueExtendedProperties", (o, n) => { (o as unknown as MailFolder).multiValueExtendedProperties = n.getCollectionOfObjectValues(createMultiValueLegacyExtendedPropertyFromDiscriminatorValue); }], + ["parentFolderId", (o, n) => { (o as unknown as MailFolder).parentFolderId = n.getStringValue(); }], + ["singleValueExtendedProperties", (o, n) => { (o as unknown as MailFolder).singleValueExtendedProperties = n.getCollectionOfObjectValues(createSingleValueLegacyExtendedPropertyFromDiscriminatorValue); }], + ["totalItemCount", (o, n) => { (o as unknown as MailFolder).totalItemCount = n.getNumberValue(); }], + ["unreadItemCount", (o, n) => { (o as unknown as MailFolder).unreadItemCount = n.getNumberValue(); }], + ]); + }; /** * Gets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. * @returns a boolean @@ -62,6 +107,13 @@ export class MailFolder extends Entity implements Parsable { public get isHidden() { return this._isHidden; }; + /** + * Sets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. + * @param value Value to set for the isHidden property. + */ + public set isHidden(value: boolean | undefined) { + this._isHidden = value; + }; /** * Gets the messageRules property value. The collection of rules that apply to the user's Inbox folder. * @returns a messageRule @@ -69,6 +121,13 @@ export class MailFolder extends Entity implements Parsable { public get messageRules() { return this._messageRules; }; + /** + * Sets the messageRules property value. The collection of rules that apply to the user's Inbox folder. + * @param value Value to set for the messageRules property. + */ + public set messageRules(value: MessageRule[] | undefined) { + this._messageRules = value; + }; /** * Gets the messages property value. The collection of messages in the mailFolder. * @returns a message @@ -76,6 +135,13 @@ export class MailFolder extends Entity implements Parsable { public get messages() { return this._messages; }; + /** + * Sets the messages property value. The collection of messages in the mailFolder. + * @param value Value to set for the messages property. + */ + public set messages(value: Message[] | undefined) { + this._messages = value; + }; /** * Gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. * @returns a multiValueLegacyExtendedProperty @@ -83,6 +149,13 @@ export class MailFolder extends Entity implements Parsable { public get multiValueExtendedProperties() { return this._multiValueExtendedProperties; }; + /** + * Sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. + * @param value Value to set for the multiValueExtendedProperties property. + */ + public set multiValueExtendedProperties(value: MultiValueLegacyExtendedProperty[] | undefined) { + this._multiValueExtendedProperties = value; + }; /** * Gets the parentFolderId property value. The unique identifier for the mailFolder's parent mailFolder. * @returns a string @@ -91,44 +164,11 @@ export class MailFolder extends Entity implements Parsable { return this._parentFolderId; }; /** - * Gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. - * @returns a singleValueLegacyExtendedProperty - */ - public get singleValueExtendedProperties() { - return this._singleValueExtendedProperties; - }; - /** - * Gets the totalItemCount property value. The number of items in the mailFolder. - * @returns a integer - */ - public get totalItemCount() { - return this._totalItemCount; - }; - /** - * Gets the unreadItemCount property value. The number of items in the mailFolder marked as unread. - * @returns a integer - */ - public get unreadItemCount() { - return this._unreadItemCount; - }; - /** - * The deserialization information for the current model - * @returns a Map void> + * Sets the parentFolderId property value. The unique identifier for the mailFolder's parent mailFolder. + * @param value Value to set for the parentFolderId property. */ - public getFieldDeserializers() : Map void> { - return new Map void>([...super.getFieldDeserializers(), - ["childFolderCount", (o, n) => { (o as unknown as MailFolder).childFolderCount = n.getNumberValue(); }], - ["childFolders", (o, n) => { (o as unknown as MailFolder).childFolders = n.getCollectionOfObjectValues(MailFolder); }], - ["displayName", (o, n) => { (o as unknown as MailFolder).displayName = n.getStringValue(); }], - ["isHidden", (o, n) => { (o as unknown as MailFolder).isHidden = n.getBooleanValue(); }], - ["messageRules", (o, n) => { (o as unknown as MailFolder).messageRules = n.getCollectionOfObjectValues(MessageRule); }], - ["messages", (o, n) => { (o as unknown as MailFolder).messages = n.getCollectionOfObjectValues(Message); }], - ["multiValueExtendedProperties", (o, n) => { (o as unknown as MailFolder).multiValueExtendedProperties = n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty); }], - ["parentFolderId", (o, n) => { (o as unknown as MailFolder).parentFolderId = n.getStringValue(); }], - ["singleValueExtendedProperties", (o, n) => { (o as unknown as MailFolder).singleValueExtendedProperties = n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty); }], - ["totalItemCount", (o, n) => { (o as unknown as MailFolder).totalItemCount = n.getNumberValue(); }], - ["unreadItemCount", (o, n) => { (o as unknown as MailFolder).unreadItemCount = n.getNumberValue(); }], - ]); + public set parentFolderId(value: string | undefined) { + this._parentFolderId = value; }; /** * Serializes information the current object @@ -150,60 +190,11 @@ export class MailFolder extends Entity implements Parsable { writer.writeNumberValue("unreadItemCount", this.unreadItemCount); }; /** - * Sets the childFolderCount property value. The number of immediate child mailFolders in the current mailFolder. - * @param value Value to set for the childFolderCount property. - */ - public set childFolderCount(value: number | undefined) { - this._childFolderCount = value; - }; - /** - * Sets the childFolders property value. The collection of child folders in the mailFolder. - * @param value Value to set for the childFolders property. - */ - public set childFolders(value: MailFolder[] | undefined) { - this._childFolders = value; - }; - /** - * Sets the displayName property value. The mailFolder's display name. - * @param value Value to set for the displayName property. - */ - public set displayName(value: string | undefined) { - this._displayName = value; - }; - /** - * Sets the isHidden property value. Indicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders. - * @param value Value to set for the isHidden property. - */ - public set isHidden(value: boolean | undefined) { - this._isHidden = value; - }; - /** - * Sets the messageRules property value. The collection of rules that apply to the user's Inbox folder. - * @param value Value to set for the messageRules property. - */ - public set messageRules(value: MessageRule[] | undefined) { - this._messageRules = value; - }; - /** - * Sets the messages property value. The collection of messages in the mailFolder. - * @param value Value to set for the messages property. - */ - public set messages(value: Message[] | undefined) { - this._messages = value; - }; - /** - * Sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. - * @param value Value to set for the multiValueExtendedProperties property. - */ - public set multiValueExtendedProperties(value: MultiValueLegacyExtendedProperty[] | undefined) { - this._multiValueExtendedProperties = value; - }; - /** - * Sets the parentFolderId property value. The unique identifier for the mailFolder's parent mailFolder. - * @param value Value to set for the parentFolderId property. + * Gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. + * @returns a singleValueLegacyExtendedProperty */ - public set parentFolderId(value: string | undefined) { - this._parentFolderId = value; + public get singleValueExtendedProperties() { + return this._singleValueExtendedProperties; }; /** * Sets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -212,6 +203,13 @@ export class MailFolder extends Entity implements Parsable { public set singleValueExtendedProperties(value: SingleValueLegacyExtendedProperty[] | undefined) { this._singleValueExtendedProperties = value; }; + /** + * Gets the totalItemCount property value. The number of items in the mailFolder. + * @returns a integer + */ + public get totalItemCount() { + return this._totalItemCount; + }; /** * Sets the totalItemCount property value. The number of items in the mailFolder. * @param value Value to set for the totalItemCount property. @@ -219,6 +217,13 @@ export class MailFolder extends Entity implements Parsable { public set totalItemCount(value: number | undefined) { this._totalItemCount = value; }; + /** + * Gets the unreadItemCount property value. The number of items in the mailFolder marked as unread. + * @returns a integer + */ + public get unreadItemCount() { + return this._unreadItemCount; + }; /** * Sets the unreadItemCount property value. The number of items in the mailFolder marked as unread. * @param value Value to set for the unreadItemCount property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/message.ts b/msgraph-mail/typescript/src/models/microsoft/graph/message.ts index 4f3482bb2..164f91707 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/message.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/message.ts @@ -1,4 +1,12 @@ import {Attachment} from './attachment'; +import {createAttachmentFromDiscriminatorValue} from './createAttachmentFromDiscriminatorValue'; +import {createExtensionFromDiscriminatorValue} from './createExtensionFromDiscriminatorValue'; +import {createFollowupFlagFromDiscriminatorValue} from './createFollowupFlagFromDiscriminatorValue'; +import {createInternetMessageHeaderFromDiscriminatorValue} from './createInternetMessageHeaderFromDiscriminatorValue'; +import {createItemBodyFromDiscriminatorValue} from './createItemBodyFromDiscriminatorValue'; +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from './createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; +import {createRecipientFromDiscriminatorValue} from './createRecipientFromDiscriminatorValue'; +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from './createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {Extension} from './extension'; import {FollowupFlag} from './followupFlag'; import {Importance} from './importance'; @@ -52,12 +60,6 @@ export class Message extends OutlookItem implements Parsable { private _toRecipients?: Recipient[] | undefined; private _uniqueBody?: ItemBody | undefined; private _webLink?: string | undefined; - /** - * Instantiates a new message and sets the default values. - */ - public constructor() { - super(); - }; /** * Gets the attachments property value. The fileAttachment and itemAttachment attachments for the message. * @returns a attachment @@ -65,6 +67,13 @@ export class Message extends OutlookItem implements Parsable { public get attachments() { return this._attachments; }; + /** + * Sets the attachments property value. The fileAttachment and itemAttachment attachments for the message. + * @param value Value to set for the attachments property. + */ + public set attachments(value: Attachment[] | undefined) { + this._attachments = value; + }; /** * Gets the bccRecipients property value. The Bcc: recipients for the message. * @returns a recipient @@ -72,6 +81,13 @@ export class Message extends OutlookItem implements Parsable { public get bccRecipients() { return this._bccRecipients; }; + /** + * Sets the bccRecipients property value. The Bcc: recipients for the message. + * @param value Value to set for the bccRecipients property. + */ + public set bccRecipients(value: Recipient[] | undefined) { + this._bccRecipients = value; + }; /** * Gets the body property value. * @returns a itemBody @@ -79,6 +95,13 @@ export class Message extends OutlookItem implements Parsable { public get body() { return this._body; }; + /** + * Sets the body property value. + * @param value Value to set for the body property. + */ + public set body(value: ItemBody | undefined) { + this._body = value; + }; /** * Gets the bodyPreview property value. The first 255 characters of the message body. It is in text format. * @returns a string @@ -86,6 +109,13 @@ export class Message extends OutlookItem implements Parsable { public get bodyPreview() { return this._bodyPreview; }; + /** + * Sets the bodyPreview property value. The first 255 characters of the message body. It is in text format. + * @param value Value to set for the bodyPreview property. + */ + public set bodyPreview(value: string | undefined) { + this._bodyPreview = value; + }; /** * Gets the ccRecipients property value. The Cc: recipients for the message. * @returns a recipient @@ -93,6 +123,19 @@ export class Message extends OutlookItem implements Parsable { public get ccRecipients() { return this._ccRecipients; }; + /** + * Sets the ccRecipients property value. The Cc: recipients for the message. + * @param value Value to set for the ccRecipients property. + */ + public set ccRecipients(value: Recipient[] | undefined) { + this._ccRecipients = value; + }; + /** + * Instantiates a new message and sets the default values. + */ + public constructor() { + super(); + }; /** * Gets the conversationId property value. The ID of the conversation the email belongs to. * @returns a string @@ -100,6 +143,13 @@ export class Message extends OutlookItem implements Parsable { public get conversationId() { return this._conversationId; }; + /** + * Sets the conversationId property value. The ID of the conversation the email belongs to. + * @param value Value to set for the conversationId property. + */ + public set conversationId(value: string | undefined) { + this._conversationId = value; + }; /** * Gets the conversationIndex property value. Indicates the position of the message within the conversation. * @returns a binary @@ -107,6 +157,13 @@ export class Message extends OutlookItem implements Parsable { public get conversationIndex() { return this._conversationIndex; }; + /** + * Sets the conversationIndex property value. Indicates the position of the message within the conversation. + * @param value Value to set for the conversationIndex property. + */ + public set conversationIndex(value: string | undefined) { + this._conversationIndex = value; + }; /** * Gets the extensions property value. The collection of open extensions defined for the message. Nullable. * @returns a extension @@ -114,6 +171,13 @@ export class Message extends OutlookItem implements Parsable { public get extensions() { return this._extensions; }; + /** + * Sets the extensions property value. The collection of open extensions defined for the message. Nullable. + * @param value Value to set for the extensions property. + */ + public set extensions(value: Extension[] | undefined) { + this._extensions = value; + }; /** * Gets the flag property value. * @returns a followupFlag @@ -121,6 +185,13 @@ export class Message extends OutlookItem implements Parsable { public get flag() { return this._flag; }; + /** + * Sets the flag property value. + * @param value Value to set for the flag property. + */ + public set flag(value: FollowupFlag | undefined) { + this._flag = value; + }; /** * Gets the from property value. * @returns a recipient @@ -128,6 +199,51 @@ export class Message extends OutlookItem implements Parsable { public get from() { return this._from; }; + /** + * Sets the from property value. + * @param value Value to set for the from property. + */ + public set from(value: Recipient | undefined) { + this._from = value; + }; + /** + * The deserialization information for the current model + * @returns a Map void> + */ + public getFieldDeserializers() : Map void> { + return new Map void>([...super.getFieldDeserializers(), + ["attachments", (o, n) => { (o as unknown as Message).attachments = n.getCollectionOfObjectValues(createAttachmentFromDiscriminatorValue); }], + ["bccRecipients", (o, n) => { (o as unknown as Message).bccRecipients = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["body", (o, n) => { (o as unknown as Message).body = n.getObjectValue(createItemBodyFromDiscriminatorValue); }], + ["bodyPreview", (o, n) => { (o as unknown as Message).bodyPreview = n.getStringValue(); }], + ["ccRecipients", (o, n) => { (o as unknown as Message).ccRecipients = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["conversationId", (o, n) => { (o as unknown as Message).conversationId = n.getStringValue(); }], + ["conversationIndex", (o, n) => { (o as unknown as Message).conversationIndex = n.getStringValue(); }], + ["extensions", (o, n) => { (o as unknown as Message).extensions = n.getCollectionOfObjectValues(createExtensionFromDiscriminatorValue); }], + ["flag", (o, n) => { (o as unknown as Message).flag = n.getObjectValue(createFollowupFlagFromDiscriminatorValue); }], + ["from", (o, n) => { (o as unknown as Message).from = n.getObjectValue(createRecipientFromDiscriminatorValue); }], + ["hasAttachments", (o, n) => { (o as unknown as Message).hasAttachments = n.getBooleanValue(); }], + ["importance", (o, n) => { (o as unknown as Message).importance = n.getEnumValue(Importance); }], + ["inferenceClassification", (o, n) => { (o as unknown as Message).inferenceClassification = n.getEnumValue(InferenceClassificationType); }], + ["internetMessageHeaders", (o, n) => { (o as unknown as Message).internetMessageHeaders = n.getCollectionOfObjectValues(createInternetMessageHeaderFromDiscriminatorValue); }], + ["internetMessageId", (o, n) => { (o as unknown as Message).internetMessageId = n.getStringValue(); }], + ["isDeliveryReceiptRequested", (o, n) => { (o as unknown as Message).isDeliveryReceiptRequested = n.getBooleanValue(); }], + ["isDraft", (o, n) => { (o as unknown as Message).isDraft = n.getBooleanValue(); }], + ["isRead", (o, n) => { (o as unknown as Message).isRead = n.getBooleanValue(); }], + ["isReadReceiptRequested", (o, n) => { (o as unknown as Message).isReadReceiptRequested = n.getBooleanValue(); }], + ["multiValueExtendedProperties", (o, n) => { (o as unknown as Message).multiValueExtendedProperties = n.getCollectionOfObjectValues(createMultiValueLegacyExtendedPropertyFromDiscriminatorValue); }], + ["parentFolderId", (o, n) => { (o as unknown as Message).parentFolderId = n.getStringValue(); }], + ["receivedDateTime", (o, n) => { (o as unknown as Message).receivedDateTime = n.getDateValue(); }], + ["replyTo", (o, n) => { (o as unknown as Message).replyTo = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["sender", (o, n) => { (o as unknown as Message).sender = n.getObjectValue(createRecipientFromDiscriminatorValue); }], + ["sentDateTime", (o, n) => { (o as unknown as Message).sentDateTime = n.getDateValue(); }], + ["singleValueExtendedProperties", (o, n) => { (o as unknown as Message).singleValueExtendedProperties = n.getCollectionOfObjectValues(createSingleValueLegacyExtendedPropertyFromDiscriminatorValue); }], + ["subject", (o, n) => { (o as unknown as Message).subject = n.getStringValue(); }], + ["toRecipients", (o, n) => { (o as unknown as Message).toRecipients = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["uniqueBody", (o, n) => { (o as unknown as Message).uniqueBody = n.getObjectValue(createItemBodyFromDiscriminatorValue); }], + ["webLink", (o, n) => { (o as unknown as Message).webLink = n.getStringValue(); }], + ]); + }; /** * Gets the hasAttachments property value. Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . * @returns a boolean @@ -135,6 +251,13 @@ export class Message extends OutlookItem implements Parsable { public get hasAttachments() { return this._hasAttachments; }; + /** + * Sets the hasAttachments property value. Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . + * @param value Value to set for the hasAttachments property. + */ + public set hasAttachments(value: boolean | undefined) { + this._hasAttachments = value; + }; /** * Gets the importance property value. * @returns a importance @@ -142,6 +265,13 @@ export class Message extends OutlookItem implements Parsable { public get importance() { return this._importance; }; + /** + * Sets the importance property value. + * @param value Value to set for the importance property. + */ + public set importance(value: Importance | undefined) { + this._importance = value; + }; /** * Gets the inferenceClassification property value. * @returns a inferenceClassificationType @@ -149,6 +279,13 @@ export class Message extends OutlookItem implements Parsable { public get inferenceClassification() { return this._inferenceClassification; }; + /** + * Sets the inferenceClassification property value. + * @param value Value to set for the inferenceClassification property. + */ + public set inferenceClassification(value: InferenceClassificationType | undefined) { + this._inferenceClassification = value; + }; /** * Gets the internetMessageHeaders property value. * @returns a internetMessageHeader @@ -156,6 +293,13 @@ export class Message extends OutlookItem implements Parsable { public get internetMessageHeaders() { return this._internetMessageHeaders; }; + /** + * Sets the internetMessageHeaders property value. + * @param value Value to set for the internetMessageHeaders property. + */ + public set internetMessageHeaders(value: InternetMessageHeader[] | undefined) { + this._internetMessageHeaders = value; + }; /** * Gets the internetMessageId property value. * @returns a string @@ -163,6 +307,13 @@ export class Message extends OutlookItem implements Parsable { public get internetMessageId() { return this._internetMessageId; }; + /** + * Sets the internetMessageId property value. + * @param value Value to set for the internetMessageId property. + */ + public set internetMessageId(value: string | undefined) { + this._internetMessageId = value; + }; /** * Gets the isDeliveryReceiptRequested property value. * @returns a boolean @@ -170,6 +321,13 @@ export class Message extends OutlookItem implements Parsable { public get isDeliveryReceiptRequested() { return this._isDeliveryReceiptRequested; }; + /** + * Sets the isDeliveryReceiptRequested property value. + * @param value Value to set for the isDeliveryReceiptRequested property. + */ + public set isDeliveryReceiptRequested(value: boolean | undefined) { + this._isDeliveryReceiptRequested = value; + }; /** * Gets the isDraft property value. * @returns a boolean @@ -177,6 +335,13 @@ export class Message extends OutlookItem implements Parsable { public get isDraft() { return this._isDraft; }; + /** + * Sets the isDraft property value. + * @param value Value to set for the isDraft property. + */ + public set isDraft(value: boolean | undefined) { + this._isDraft = value; + }; /** * Gets the isRead property value. * @returns a boolean @@ -184,6 +349,13 @@ export class Message extends OutlookItem implements Parsable { public get isRead() { return this._isRead; }; + /** + * Sets the isRead property value. + * @param value Value to set for the isRead property. + */ + public set isRead(value: boolean | undefined) { + this._isRead = value; + }; /** * Gets the isReadReceiptRequested property value. * @returns a boolean @@ -191,6 +363,13 @@ export class Message extends OutlookItem implements Parsable { public get isReadReceiptRequested() { return this._isReadReceiptRequested; }; + /** + * Sets the isReadReceiptRequested property value. + * @param value Value to set for the isReadReceiptRequested property. + */ + public set isReadReceiptRequested(value: boolean | undefined) { + this._isReadReceiptRequested = value; + }; /** * Gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. * @returns a multiValueLegacyExtendedProperty @@ -198,6 +377,13 @@ export class Message extends OutlookItem implements Parsable { public get multiValueExtendedProperties() { return this._multiValueExtendedProperties; }; + /** + * Sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. + * @param value Value to set for the multiValueExtendedProperties property. + */ + public set multiValueExtendedProperties(value: MultiValueLegacyExtendedProperty[] | undefined) { + this._multiValueExtendedProperties = value; + }; /** * Gets the parentFolderId property value. * @returns a string @@ -205,6 +391,13 @@ export class Message extends OutlookItem implements Parsable { public get parentFolderId() { return this._parentFolderId; }; + /** + * Sets the parentFolderId property value. + * @param value Value to set for the parentFolderId property. + */ + public set parentFolderId(value: string | undefined) { + this._parentFolderId = value; + }; /** * Gets the receivedDateTime property value. * @returns a Date @@ -212,6 +405,13 @@ export class Message extends OutlookItem implements Parsable { public get receivedDateTime() { return this._receivedDateTime; }; + /** + * Sets the receivedDateTime property value. + * @param value Value to set for the receivedDateTime property. + */ + public set receivedDateTime(value: Date | undefined) { + this._receivedDateTime = value; + }; /** * Gets the replyTo property value. * @returns a recipient @@ -219,6 +419,13 @@ export class Message extends OutlookItem implements Parsable { public get replyTo() { return this._replyTo; }; + /** + * Sets the replyTo property value. + * @param value Value to set for the replyTo property. + */ + public set replyTo(value: Recipient[] | undefined) { + this._replyTo = value; + }; /** * Gets the sender property value. * @returns a recipient @@ -226,6 +433,13 @@ export class Message extends OutlookItem implements Parsable { public get sender() { return this._sender; }; + /** + * Sets the sender property value. + * @param value Value to set for the sender property. + */ + public set sender(value: Recipient | undefined) { + this._sender = value; + }; /** * Gets the sentDateTime property value. * @returns a Date @@ -234,77 +448,11 @@ export class Message extends OutlookItem implements Parsable { return this._sentDateTime; }; /** - * Gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. - * @returns a singleValueLegacyExtendedProperty - */ - public get singleValueExtendedProperties() { - return this._singleValueExtendedProperties; - }; - /** - * Gets the subject property value. - * @returns a string - */ - public get subject() { - return this._subject; - }; - /** - * Gets the toRecipients property value. - * @returns a recipient - */ - public get toRecipients() { - return this._toRecipients; - }; - /** - * Gets the uniqueBody property value. - * @returns a itemBody - */ - public get uniqueBody() { - return this._uniqueBody; - }; - /** - * Gets the webLink property value. - * @returns a string - */ - public get webLink() { - return this._webLink; - }; - /** - * The deserialization information for the current model - * @returns a Map void> + * Sets the sentDateTime property value. + * @param value Value to set for the sentDateTime property. */ - public getFieldDeserializers() : Map void> { - return new Map void>([...super.getFieldDeserializers(), - ["attachments", (o, n) => { (o as unknown as Message).attachments = n.getCollectionOfObjectValues(Attachment); }], - ["bccRecipients", (o, n) => { (o as unknown as Message).bccRecipients = n.getCollectionOfObjectValues(Recipient); }], - ["body", (o, n) => { (o as unknown as Message).body = n.getObjectValue(ItemBody); }], - ["bodyPreview", (o, n) => { (o as unknown as Message).bodyPreview = n.getStringValue(); }], - ["ccRecipients", (o, n) => { (o as unknown as Message).ccRecipients = n.getCollectionOfObjectValues(Recipient); }], - ["conversationId", (o, n) => { (o as unknown as Message).conversationId = n.getStringValue(); }], - ["conversationIndex", (o, n) => { (o as unknown as Message).conversationIndex = n.getStringValue(); }], - ["extensions", (o, n) => { (o as unknown as Message).extensions = n.getCollectionOfObjectValues(Extension); }], - ["flag", (o, n) => { (o as unknown as Message).flag = n.getObjectValue(FollowupFlag); }], - ["from", (o, n) => { (o as unknown as Message).from = n.getObjectValue(Recipient); }], - ["hasAttachments", (o, n) => { (o as unknown as Message).hasAttachments = n.getBooleanValue(); }], - ["importance", (o, n) => { (o as unknown as Message).importance = n.getEnumValue(Importance); }], - ["inferenceClassification", (o, n) => { (o as unknown as Message).inferenceClassification = n.getEnumValue(InferenceClassificationType); }], - ["internetMessageHeaders", (o, n) => { (o as unknown as Message).internetMessageHeaders = n.getCollectionOfObjectValues(InternetMessageHeader); }], - ["internetMessageId", (o, n) => { (o as unknown as Message).internetMessageId = n.getStringValue(); }], - ["isDeliveryReceiptRequested", (o, n) => { (o as unknown as Message).isDeliveryReceiptRequested = n.getBooleanValue(); }], - ["isDraft", (o, n) => { (o as unknown as Message).isDraft = n.getBooleanValue(); }], - ["isRead", (o, n) => { (o as unknown as Message).isRead = n.getBooleanValue(); }], - ["isReadReceiptRequested", (o, n) => { (o as unknown as Message).isReadReceiptRequested = n.getBooleanValue(); }], - ["multiValueExtendedProperties", (o, n) => { (o as unknown as Message).multiValueExtendedProperties = n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty); }], - ["parentFolderId", (o, n) => { (o as unknown as Message).parentFolderId = n.getStringValue(); }], - ["receivedDateTime", (o, n) => { (o as unknown as Message).receivedDateTime = n.getDateValue(); }], - ["replyTo", (o, n) => { (o as unknown as Message).replyTo = n.getCollectionOfObjectValues(Recipient); }], - ["sender", (o, n) => { (o as unknown as Message).sender = n.getObjectValue(Recipient); }], - ["sentDateTime", (o, n) => { (o as unknown as Message).sentDateTime = n.getDateValue(); }], - ["singleValueExtendedProperties", (o, n) => { (o as unknown as Message).singleValueExtendedProperties = n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty); }], - ["subject", (o, n) => { (o as unknown as Message).subject = n.getStringValue(); }], - ["toRecipients", (o, n) => { (o as unknown as Message).toRecipients = n.getCollectionOfObjectValues(Recipient); }], - ["uniqueBody", (o, n) => { (o as unknown as Message).uniqueBody = n.getObjectValue(ItemBody); }], - ["webLink", (o, n) => { (o as unknown as Message).webLink = n.getStringValue(); }], - ]); + public set sentDateTime(value: Date | undefined) { + this._sentDateTime = value; }; /** * Serializes information the current object @@ -345,179 +493,11 @@ export class Message extends OutlookItem implements Parsable { writer.writeStringValue("webLink", this.webLink); }; /** - * Sets the attachments property value. The fileAttachment and itemAttachment attachments for the message. - * @param value Value to set for the attachments property. - */ - public set attachments(value: Attachment[] | undefined) { - this._attachments = value; - }; - /** - * Sets the bccRecipients property value. The Bcc: recipients for the message. - * @param value Value to set for the bccRecipients property. - */ - public set bccRecipients(value: Recipient[] | undefined) { - this._bccRecipients = value; - }; - /** - * Sets the body property value. - * @param value Value to set for the body property. - */ - public set body(value: ItemBody | undefined) { - this._body = value; - }; - /** - * Sets the bodyPreview property value. The first 255 characters of the message body. It is in text format. - * @param value Value to set for the bodyPreview property. - */ - public set bodyPreview(value: string | undefined) { - this._bodyPreview = value; - }; - /** - * Sets the ccRecipients property value. The Cc: recipients for the message. - * @param value Value to set for the ccRecipients property. - */ - public set ccRecipients(value: Recipient[] | undefined) { - this._ccRecipients = value; - }; - /** - * Sets the conversationId property value. The ID of the conversation the email belongs to. - * @param value Value to set for the conversationId property. - */ - public set conversationId(value: string | undefined) { - this._conversationId = value; - }; - /** - * Sets the conversationIndex property value. Indicates the position of the message within the conversation. - * @param value Value to set for the conversationIndex property. - */ - public set conversationIndex(value: string | undefined) { - this._conversationIndex = value; - }; - /** - * Sets the extensions property value. The collection of open extensions defined for the message. Nullable. - * @param value Value to set for the extensions property. - */ - public set extensions(value: Extension[] | undefined) { - this._extensions = value; - }; - /** - * Sets the flag property value. - * @param value Value to set for the flag property. - */ - public set flag(value: FollowupFlag | undefined) { - this._flag = value; - }; - /** - * Sets the from property value. - * @param value Value to set for the from property. - */ - public set from(value: Recipient | undefined) { - this._from = value; - }; - /** - * Sets the hasAttachments property value. Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as . - * @param value Value to set for the hasAttachments property. - */ - public set hasAttachments(value: boolean | undefined) { - this._hasAttachments = value; - }; - /** - * Sets the importance property value. - * @param value Value to set for the importance property. - */ - public set importance(value: Importance | undefined) { - this._importance = value; - }; - /** - * Sets the inferenceClassification property value. - * @param value Value to set for the inferenceClassification property. - */ - public set inferenceClassification(value: InferenceClassificationType | undefined) { - this._inferenceClassification = value; - }; - /** - * Sets the internetMessageHeaders property value. - * @param value Value to set for the internetMessageHeaders property. - */ - public set internetMessageHeaders(value: InternetMessageHeader[] | undefined) { - this._internetMessageHeaders = value; - }; - /** - * Sets the internetMessageId property value. - * @param value Value to set for the internetMessageId property. - */ - public set internetMessageId(value: string | undefined) { - this._internetMessageId = value; - }; - /** - * Sets the isDeliveryReceiptRequested property value. - * @param value Value to set for the isDeliveryReceiptRequested property. - */ - public set isDeliveryReceiptRequested(value: boolean | undefined) { - this._isDeliveryReceiptRequested = value; - }; - /** - * Sets the isDraft property value. - * @param value Value to set for the isDraft property. - */ - public set isDraft(value: boolean | undefined) { - this._isDraft = value; - }; - /** - * Sets the isRead property value. - * @param value Value to set for the isRead property. - */ - public set isRead(value: boolean | undefined) { - this._isRead = value; - }; - /** - * Sets the isReadReceiptRequested property value. - * @param value Value to set for the isReadReceiptRequested property. - */ - public set isReadReceiptRequested(value: boolean | undefined) { - this._isReadReceiptRequested = value; - }; - /** - * Sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the message. Nullable. - * @param value Value to set for the multiValueExtendedProperties property. - */ - public set multiValueExtendedProperties(value: MultiValueLegacyExtendedProperty[] | undefined) { - this._multiValueExtendedProperties = value; - }; - /** - * Sets the parentFolderId property value. - * @param value Value to set for the parentFolderId property. - */ - public set parentFolderId(value: string | undefined) { - this._parentFolderId = value; - }; - /** - * Sets the receivedDateTime property value. - * @param value Value to set for the receivedDateTime property. - */ - public set receivedDateTime(value: Date | undefined) { - this._receivedDateTime = value; - }; - /** - * Sets the replyTo property value. - * @param value Value to set for the replyTo property. - */ - public set replyTo(value: Recipient[] | undefined) { - this._replyTo = value; - }; - /** - * Sets the sender property value. - * @param value Value to set for the sender property. - */ - public set sender(value: Recipient | undefined) { - this._sender = value; - }; - /** - * Sets the sentDateTime property value. - * @param value Value to set for the sentDateTime property. + * Gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. + * @returns a singleValueLegacyExtendedProperty */ - public set sentDateTime(value: Date | undefined) { - this._sentDateTime = value; + public get singleValueExtendedProperties() { + return this._singleValueExtendedProperties; }; /** * Sets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the message. Nullable. @@ -526,6 +506,13 @@ export class Message extends OutlookItem implements Parsable { public set singleValueExtendedProperties(value: SingleValueLegacyExtendedProperty[] | undefined) { this._singleValueExtendedProperties = value; }; + /** + * Gets the subject property value. + * @returns a string + */ + public get subject() { + return this._subject; + }; /** * Sets the subject property value. * @param value Value to set for the subject property. @@ -533,6 +520,13 @@ export class Message extends OutlookItem implements Parsable { public set subject(value: string | undefined) { this._subject = value; }; + /** + * Gets the toRecipients property value. + * @returns a recipient + */ + public get toRecipients() { + return this._toRecipients; + }; /** * Sets the toRecipients property value. * @param value Value to set for the toRecipients property. @@ -540,6 +534,13 @@ export class Message extends OutlookItem implements Parsable { public set toRecipients(value: Recipient[] | undefined) { this._toRecipients = value; }; + /** + * Gets the uniqueBody property value. + * @returns a itemBody + */ + public get uniqueBody() { + return this._uniqueBody; + }; /** * Sets the uniqueBody property value. * @param value Value to set for the uniqueBody property. @@ -547,6 +548,13 @@ export class Message extends OutlookItem implements Parsable { public set uniqueBody(value: ItemBody | undefined) { this._uniqueBody = value; }; + /** + * Gets the webLink property value. + * @returns a string + */ + public get webLink() { + return this._webLink; + }; /** * Sets the webLink property value. * @param value Value to set for the webLink property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/messageRule.ts b/msgraph-mail/typescript/src/models/microsoft/graph/messageRule.ts index 951d7e10c..ca6a7ce99 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/messageRule.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/messageRule.ts @@ -1,3 +1,5 @@ +import {createMessageRuleActionsFromDiscriminatorValue} from './createMessageRuleActionsFromDiscriminatorValue'; +import {createMessageRulePredicatesFromDiscriminatorValue} from './createMessageRulePredicatesFromDiscriminatorValue'; import {Entity} from './entity'; import {MessageRuleActions} from './messageRuleActions'; import {MessageRulePredicates} from './messageRulePredicates'; @@ -17,12 +19,6 @@ export class MessageRule extends Entity implements Parsable { private _isReadOnly?: boolean | undefined; /** Indicates the order in which the rule is executed, among other rules. */ private _sequence?: number | undefined; - /** - * Instantiates a new messageRule and sets the default values. - */ - public constructor() { - super(); - }; /** * Gets the actions property value. * @returns a messageRuleActions @@ -30,6 +26,13 @@ export class MessageRule extends Entity implements Parsable { public get actions() { return this._actions; }; + /** + * Sets the actions property value. + * @param value Value to set for the actions property. + */ + public set actions(value: MessageRuleActions | undefined) { + this._actions = value; + }; /** * Gets the conditions property value. * @returns a messageRulePredicates @@ -38,46 +41,45 @@ export class MessageRule extends Entity implements Parsable { return this._conditions; }; /** - * Gets the displayName property value. The display name of the rule. - * @returns a string + * Sets the conditions property value. + * @param value Value to set for the conditions property. */ - public get displayName() { - return this._displayName; + public set conditions(value: MessageRulePredicates | undefined) { + this._conditions = value; }; /** - * Gets the exceptions property value. - * @returns a messageRulePredicates + * Instantiates a new messageRule and sets the default values. */ - public get exceptions() { - return this._exceptions; + public constructor() { + super(); }; /** - * Gets the hasError property value. Indicates whether the rule is in an error condition. Read-only. - * @returns a boolean + * Gets the displayName property value. The display name of the rule. + * @returns a string */ - public get hasError() { - return this._hasError; + public get displayName() { + return this._displayName; }; /** - * Gets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages. - * @returns a boolean + * Sets the displayName property value. The display name of the rule. + * @param value Value to set for the displayName property. */ - public get isEnabled() { - return this._isEnabled; + public set displayName(value: string | undefined) { + this._displayName = value; }; /** - * Gets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. - * @returns a boolean + * Gets the exceptions property value. + * @returns a messageRulePredicates */ - public get isReadOnly() { - return this._isReadOnly; + public get exceptions() { + return this._exceptions; }; /** - * Gets the sequence property value. Indicates the order in which the rule is executed, among other rules. - * @returns a integer + * Sets the exceptions property value. + * @param value Value to set for the exceptions property. */ - public get sequence() { - return this._sequence; + public set exceptions(value: MessageRulePredicates | undefined) { + this._exceptions = value; }; /** * The deserialization information for the current model @@ -85,10 +87,10 @@ export class MessageRule extends Entity implements Parsable { */ public getFieldDeserializers() : Map void> { return new Map void>([...super.getFieldDeserializers(), - ["actions", (o, n) => { (o as unknown as MessageRule).actions = n.getObjectValue(MessageRuleActions); }], - ["conditions", (o, n) => { (o as unknown as MessageRule).conditions = n.getObjectValue(MessageRulePredicates); }], + ["actions", (o, n) => { (o as unknown as MessageRule).actions = n.getObjectValue(createMessageRuleActionsFromDiscriminatorValue); }], + ["conditions", (o, n) => { (o as unknown as MessageRule).conditions = n.getObjectValue(createMessageRulePredicatesFromDiscriminatorValue); }], ["displayName", (o, n) => { (o as unknown as MessageRule).displayName = n.getStringValue(); }], - ["exceptions", (o, n) => { (o as unknown as MessageRule).exceptions = n.getObjectValue(MessageRulePredicates); }], + ["exceptions", (o, n) => { (o as unknown as MessageRule).exceptions = n.getObjectValue(createMessageRulePredicatesFromDiscriminatorValue); }], ["hasError", (o, n) => { (o as unknown as MessageRule).hasError = n.getBooleanValue(); }], ["isEnabled", (o, n) => { (o as unknown as MessageRule).isEnabled = n.getBooleanValue(); }], ["isReadOnly", (o, n) => { (o as unknown as MessageRule).isReadOnly = n.getBooleanValue(); }], @@ -96,48 +98,11 @@ export class MessageRule extends Entity implements Parsable { ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - super.serialize(writer); - writer.writeObjectValue("actions", this.actions); - writer.writeObjectValue("conditions", this.conditions); - writer.writeStringValue("displayName", this.displayName); - writer.writeObjectValue("exceptions", this.exceptions); - writer.writeBooleanValue("hasError", this.hasError); - writer.writeBooleanValue("isEnabled", this.isEnabled); - writer.writeBooleanValue("isReadOnly", this.isReadOnly); - writer.writeNumberValue("sequence", this.sequence); - }; - /** - * Sets the actions property value. - * @param value Value to set for the actions property. - */ - public set actions(value: MessageRuleActions | undefined) { - this._actions = value; - }; - /** - * Sets the conditions property value. - * @param value Value to set for the conditions property. - */ - public set conditions(value: MessageRulePredicates | undefined) { - this._conditions = value; - }; - /** - * Sets the displayName property value. The display name of the rule. - * @param value Value to set for the displayName property. - */ - public set displayName(value: string | undefined) { - this._displayName = value; - }; - /** - * Sets the exceptions property value. - * @param value Value to set for the exceptions property. + * Gets the hasError property value. Indicates whether the rule is in an error condition. Read-only. + * @returns a boolean */ - public set exceptions(value: MessageRulePredicates | undefined) { - this._exceptions = value; + public get hasError() { + return this._hasError; }; /** * Sets the hasError property value. Indicates whether the rule is in an error condition. Read-only. @@ -146,6 +111,13 @@ export class MessageRule extends Entity implements Parsable { public set hasError(value: boolean | undefined) { this._hasError = value; }; + /** + * Gets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages. + * @returns a boolean + */ + public get isEnabled() { + return this._isEnabled; + }; /** * Sets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages. * @param value Value to set for the isEnabled property. @@ -153,6 +125,13 @@ export class MessageRule extends Entity implements Parsable { public set isEnabled(value: boolean | undefined) { this._isEnabled = value; }; + /** + * Gets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. + * @returns a boolean + */ + public get isReadOnly() { + return this._isReadOnly; + }; /** * Sets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. * @param value Value to set for the isReadOnly property. @@ -160,6 +139,13 @@ export class MessageRule extends Entity implements Parsable { public set isReadOnly(value: boolean | undefined) { this._isReadOnly = value; }; + /** + * Gets the sequence property value. Indicates the order in which the rule is executed, among other rules. + * @returns a integer + */ + public get sequence() { + return this._sequence; + }; /** * Sets the sequence property value. Indicates the order in which the rule is executed, among other rules. * @param value Value to set for the sequence property. @@ -167,4 +153,20 @@ export class MessageRule extends Entity implements Parsable { public set sequence(value: number | undefined) { this._sequence = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + super.serialize(writer); + writer.writeObjectValue("actions", this.actions); + writer.writeObjectValue("conditions", this.conditions); + writer.writeStringValue("displayName", this.displayName); + writer.writeObjectValue("exceptions", this.exceptions); + writer.writeBooleanValue("hasError", this.hasError); + writer.writeBooleanValue("isEnabled", this.isEnabled); + writer.writeBooleanValue("isReadOnly", this.isReadOnly); + writer.writeNumberValue("sequence", this.sequence); + }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/messageRuleActions.ts b/msgraph-mail/typescript/src/models/microsoft/graph/messageRuleActions.ts index cef6c03c7..76b6c8097 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/messageRuleActions.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/messageRuleActions.ts @@ -1,3 +1,4 @@ +import {createRecipientFromDiscriminatorValue} from './createRecipientFromDiscriminatorValue'; import {Importance} from './importance'; import {Recipient} from './recipient'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -27,18 +28,19 @@ export class MessageRuleActions implements Parsable { /** Indicates whether subsequent rules should be evaluated. */ private _stopProcessingRules?: boolean | undefined; /** - * Instantiates a new messageRuleActions and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; /** * Gets the assignCategories property value. A list of categories to be assigned to a message. * @returns a string @@ -46,6 +48,19 @@ export class MessageRuleActions implements Parsable { public get assignCategories() { return this._assignCategories; }; + /** + * Sets the assignCategories property value. A list of categories to be assigned to a message. + * @param value Value to set for the assignCategories property. + */ + public set assignCategories(value: string[] | undefined) { + this._assignCategories = value; + }; + /** + * Instantiates a new messageRuleActions and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); + }; /** * Gets the copyToFolder property value. The ID of a folder that a message is to be copied to. * @returns a string @@ -53,6 +68,13 @@ export class MessageRuleActions implements Parsable { public get copyToFolder() { return this._copyToFolder; }; + /** + * Sets the copyToFolder property value. The ID of a folder that a message is to be copied to. + * @param value Value to set for the copyToFolder property. + */ + public set copyToFolder(value: string | undefined) { + this._copyToFolder = value; + }; /** * Gets the delete property value. Indicates whether a message should be moved to the Deleted Items folder. * @returns a boolean @@ -60,6 +82,13 @@ export class MessageRuleActions implements Parsable { public get delete() { return this._delete; }; + /** + * Sets the delete property value. Indicates whether a message should be moved to the Deleted Items folder. + * @param value Value to set for the delete property. + */ + public set delete(value: boolean | undefined) { + this._delete = value; + }; /** * Gets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. * @returns a recipient @@ -67,6 +96,13 @@ export class MessageRuleActions implements Parsable { public get forwardAsAttachmentTo() { return this._forwardAsAttachmentTo; }; + /** + * Sets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. + * @param value Value to set for the forwardAsAttachmentTo property. + */ + public set forwardAsAttachmentTo(value: Recipient[] | undefined) { + this._forwardAsAttachmentTo = value; + }; /** * Gets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. * @returns a recipient @@ -74,6 +110,32 @@ export class MessageRuleActions implements Parsable { public get forwardTo() { return this._forwardTo; }; + /** + * Sets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. + * @param value Value to set for the forwardTo property. + */ + public set forwardTo(value: Recipient[] | undefined) { + this._forwardTo = value; + }; + /** + * The deserialization information for the current model + * @returns a Map void> + */ + public getFieldDeserializers() : Map void> { + return new Map void>([ + ["assignCategories", (o, n) => { (o as unknown as MessageRuleActions).assignCategories = n.getCollectionOfPrimitiveValues(); }], + ["copyToFolder", (o, n) => { (o as unknown as MessageRuleActions).copyToFolder = n.getStringValue(); }], + ["delete", (o, n) => { (o as unknown as MessageRuleActions).delete = n.getBooleanValue(); }], + ["forwardAsAttachmentTo", (o, n) => { (o as unknown as MessageRuleActions).forwardAsAttachmentTo = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["forwardTo", (o, n) => { (o as unknown as MessageRuleActions).forwardTo = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["markAsRead", (o, n) => { (o as unknown as MessageRuleActions).markAsRead = n.getBooleanValue(); }], + ["markImportance", (o, n) => { (o as unknown as MessageRuleActions).markImportance = n.getEnumValue(Importance); }], + ["moveToFolder", (o, n) => { (o as unknown as MessageRuleActions).moveToFolder = n.getStringValue(); }], + ["permanentDelete", (o, n) => { (o as unknown as MessageRuleActions).permanentDelete = n.getBooleanValue(); }], + ["redirectTo", (o, n) => { (o as unknown as MessageRuleActions).redirectTo = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], + ["stopProcessingRules", (o, n) => { (o as unknown as MessageRuleActions).stopProcessingRules = n.getBooleanValue(); }], + ]); + }; /** * Gets the markAsRead property value. Indicates whether a message should be marked as read. * @returns a boolean @@ -81,6 +143,13 @@ export class MessageRuleActions implements Parsable { public get markAsRead() { return this._markAsRead; }; + /** + * Sets the markAsRead property value. Indicates whether a message should be marked as read. + * @param value Value to set for the markAsRead property. + */ + public set markAsRead(value: boolean | undefined) { + this._markAsRead = value; + }; /** * Gets the markImportance property value. * @returns a importance @@ -88,6 +157,13 @@ export class MessageRuleActions implements Parsable { public get markImportance() { return this._markImportance; }; + /** + * Sets the markImportance property value. + * @param value Value to set for the markImportance property. + */ + public set markImportance(value: Importance | undefined) { + this._markImportance = value; + }; /** * Gets the moveToFolder property value. The ID of the folder that a message will be moved to. * @returns a string @@ -95,6 +171,13 @@ export class MessageRuleActions implements Parsable { public get moveToFolder() { return this._moveToFolder; }; + /** + * Sets the moveToFolder property value. The ID of the folder that a message will be moved to. + * @param value Value to set for the moveToFolder property. + */ + public set moveToFolder(value: string | undefined) { + this._moveToFolder = value; + }; /** * Gets the permanentDelete property value. Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. * @returns a boolean @@ -102,6 +185,13 @@ export class MessageRuleActions implements Parsable { public get permanentDelete() { return this._permanentDelete; }; + /** + * Sets the permanentDelete property value. Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. + * @param value Value to set for the permanentDelete property. + */ + public set permanentDelete(value: boolean | undefined) { + this._permanentDelete = value; + }; /** * Gets the redirectTo property value. The email addresses to which a message should be redirected. * @returns a recipient @@ -110,30 +200,11 @@ export class MessageRuleActions implements Parsable { return this._redirectTo; }; /** - * Gets the stopProcessingRules property value. Indicates whether subsequent rules should be evaluated. - * @returns a boolean - */ - public get stopProcessingRules() { - return this._stopProcessingRules; - }; - /** - * The deserialization information for the current model - * @returns a Map void> + * Sets the redirectTo property value. The email addresses to which a message should be redirected. + * @param value Value to set for the redirectTo property. */ - public getFieldDeserializers() : Map void> { - return new Map void>([ - ["assignCategories", (o, n) => { (o as unknown as MessageRuleActions).assignCategories = n.getCollectionOfPrimitiveValues(); }], - ["copyToFolder", (o, n) => { (o as unknown as MessageRuleActions).copyToFolder = n.getStringValue(); }], - ["delete", (o, n) => { (o as unknown as MessageRuleActions).delete = n.getBooleanValue(); }], - ["forwardAsAttachmentTo", (o, n) => { (o as unknown as MessageRuleActions).forwardAsAttachmentTo = n.getCollectionOfObjectValues(Recipient); }], - ["forwardTo", (o, n) => { (o as unknown as MessageRuleActions).forwardTo = n.getCollectionOfObjectValues(Recipient); }], - ["markAsRead", (o, n) => { (o as unknown as MessageRuleActions).markAsRead = n.getBooleanValue(); }], - ["markImportance", (o, n) => { (o as unknown as MessageRuleActions).markImportance = n.getEnumValue(Importance); }], - ["moveToFolder", (o, n) => { (o as unknown as MessageRuleActions).moveToFolder = n.getStringValue(); }], - ["permanentDelete", (o, n) => { (o as unknown as MessageRuleActions).permanentDelete = n.getBooleanValue(); }], - ["redirectTo", (o, n) => { (o as unknown as MessageRuleActions).redirectTo = n.getCollectionOfObjectValues(Recipient); }], - ["stopProcessingRules", (o, n) => { (o as unknown as MessageRuleActions).stopProcessingRules = n.getBooleanValue(); }], - ]); + public set redirectTo(value: Recipient[] | undefined) { + this._redirectTo = value; }; /** * Serializes information the current object @@ -155,81 +226,11 @@ export class MessageRuleActions implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the assignCategories property value. A list of categories to be assigned to a message. - * @param value Value to set for the assignCategories property. - */ - public set assignCategories(value: string[] | undefined) { - this._assignCategories = value; - }; - /** - * Sets the copyToFolder property value. The ID of a folder that a message is to be copied to. - * @param value Value to set for the copyToFolder property. - */ - public set copyToFolder(value: string | undefined) { - this._copyToFolder = value; - }; - /** - * Sets the delete property value. Indicates whether a message should be moved to the Deleted Items folder. - * @param value Value to set for the delete property. - */ - public set delete(value: boolean | undefined) { - this._delete = value; - }; - /** - * Sets the forwardAsAttachmentTo property value. The email addresses of the recipients to which a message should be forwarded as an attachment. - * @param value Value to set for the forwardAsAttachmentTo property. - */ - public set forwardAsAttachmentTo(value: Recipient[] | undefined) { - this._forwardAsAttachmentTo = value; - }; - /** - * Sets the forwardTo property value. The email addresses of the recipients to which a message should be forwarded. - * @param value Value to set for the forwardTo property. - */ - public set forwardTo(value: Recipient[] | undefined) { - this._forwardTo = value; - }; - /** - * Sets the markAsRead property value. Indicates whether a message should be marked as read. - * @param value Value to set for the markAsRead property. - */ - public set markAsRead(value: boolean | undefined) { - this._markAsRead = value; - }; - /** - * Sets the markImportance property value. - * @param value Value to set for the markImportance property. - */ - public set markImportance(value: Importance | undefined) { - this._markImportance = value; - }; - /** - * Sets the moveToFolder property value. The ID of the folder that a message will be moved to. - * @param value Value to set for the moveToFolder property. - */ - public set moveToFolder(value: string | undefined) { - this._moveToFolder = value; - }; - /** - * Sets the permanentDelete property value. Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. - * @param value Value to set for the permanentDelete property. - */ - public set permanentDelete(value: boolean | undefined) { - this._permanentDelete = value; - }; - /** - * Sets the redirectTo property value. The email addresses to which a message should be redirected. - * @param value Value to set for the redirectTo property. + * Gets the stopProcessingRules property value. Indicates whether subsequent rules should be evaluated. + * @returns a boolean */ - public set redirectTo(value: Recipient[] | undefined) { - this._redirectTo = value; + public get stopProcessingRules() { + return this._stopProcessingRules; }; /** * Sets the stopProcessingRules property value. Indicates whether subsequent rules should be evaluated. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/messageRulePredicates.ts b/msgraph-mail/typescript/src/models/microsoft/graph/messageRulePredicates.ts index 6eb9d2c95..882e772bd 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/messageRulePredicates.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/messageRulePredicates.ts @@ -1,3 +1,5 @@ +import {createRecipientFromDiscriminatorValue} from './createRecipientFromDiscriminatorValue'; +import {createSizeRangeFromDiscriminatorValue} from './createSizeRangeFromDiscriminatorValue'; import {Importance} from './importance'; import {MessageActionFlag} from './messageActionFlag'; import {Recipient} from './recipient'; @@ -65,227 +67,80 @@ export class MessageRulePredicates implements Parsable { private _subjectContains?: string[] | undefined; private _withinSizeRange?: SizeRange | undefined; /** - * Instantiates a new messageRulePredicates and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the bodyContains property value. Represents the strings that should appear in the body of an incoming message in order for the condition or exception to apply. - * @returns a string - */ - public get bodyContains() { - return this._bodyContains; - }; - /** - * Gets the bodyOrSubjectContains property value. Represents the strings that should appear in the body or subject of an incoming message in order for the condition or exception to apply. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get bodyOrSubjectContains() { - return this._bodyOrSubjectContains; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the categories property value. Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply. + * Gets the bodyContains property value. Represents the strings that should appear in the body of an incoming message in order for the condition or exception to apply. * @returns a string */ - public get categories() { - return this._categories; - }; - /** - * Gets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. - * @returns a recipient - */ - public get fromAddresses() { - return this._fromAddresses; + public get bodyContains() { + return this._bodyContains; }; /** - * Gets the hasAttachments property value. Indicates whether an incoming message must have attachments in order for the condition or exception to apply. - * @returns a boolean + * Sets the bodyContains property value. Represents the strings that should appear in the body of an incoming message in order for the condition or exception to apply. + * @param value Value to set for the bodyContains property. */ - public get hasAttachments() { - return this._hasAttachments; + public set bodyContains(value: string[] | undefined) { + this._bodyContains = value; }; /** - * Gets the headerContains property value. Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. + * Gets the bodyOrSubjectContains property value. Represents the strings that should appear in the body or subject of an incoming message in order for the condition or exception to apply. * @returns a string */ - public get headerContains() { - return this._headerContains; - }; - /** - * Gets the importance property value. - * @returns a importance - */ - public get importance() { - return this._importance; - }; - /** - * Gets the isApprovalRequest property value. Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. - * @returns a boolean - */ - public get isApprovalRequest() { - return this._isApprovalRequest; - }; - /** - * Gets the isAutomaticForward property value. Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. - * @returns a boolean - */ - public get isAutomaticForward() { - return this._isAutomaticForward; - }; - /** - * Gets the isAutomaticReply property value. Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. - * @returns a boolean - */ - public get isAutomaticReply() { - return this._isAutomaticReply; - }; - /** - * Gets the isEncrypted property value. Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. - * @returns a boolean - */ - public get isEncrypted() { - return this._isEncrypted; - }; - /** - * Gets the isMeetingRequest property value. Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. - * @returns a boolean - */ - public get isMeetingRequest() { - return this._isMeetingRequest; - }; - /** - * Gets the isMeetingResponse property value. Indicates whether an incoming message must be a meeting response in order for the condition or exception to apply. - * @returns a boolean - */ - public get isMeetingResponse() { - return this._isMeetingResponse; - }; - /** - * Gets the isNonDeliveryReport property value. Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to apply. - * @returns a boolean - */ - public get isNonDeliveryReport() { - return this._isNonDeliveryReport; - }; - /** - * Gets the isPermissionControlled property value. Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or exception to apply. - * @returns a boolean - */ - public get isPermissionControlled() { - return this._isPermissionControlled; - }; - /** - * Gets the isReadReceipt property value. Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. - * @returns a boolean - */ - public get isReadReceipt() { - return this._isReadReceipt; - }; - /** - * Gets the isSigned property value. Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. - * @returns a boolean - */ - public get isSigned() { - return this._isSigned; - }; - /** - * Gets the isVoicemail property value. Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. - * @returns a boolean - */ - public get isVoicemail() { - return this._isVoicemail; - }; - /** - * Gets the messageActionFlag property value. - * @returns a messageActionFlag - */ - public get messageActionFlag() { - return this._messageActionFlag; - }; - /** - * Gets the notSentToMe property value. Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. - * @returns a boolean - */ - public get notSentToMe() { - return this._notSentToMe; + public get bodyOrSubjectContains() { + return this._bodyOrSubjectContains; }; /** - * Gets the recipientContains property value. Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. - * @returns a string + * Sets the bodyOrSubjectContains property value. Represents the strings that should appear in the body or subject of an incoming message in order for the condition or exception to apply. + * @param value Value to set for the bodyOrSubjectContains property. */ - public get recipientContains() { - return this._recipientContains; + public set bodyOrSubjectContains(value: string[] | undefined) { + this._bodyOrSubjectContains = value; }; /** - * Gets the senderContains property value. Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. + * Gets the categories property value. Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply. * @returns a string */ - public get senderContains() { - return this._senderContains; - }; - /** - * Gets the sensitivity property value. - * @returns a sensitivity - */ - public get sensitivity() { - return this._sensitivity; + public get categories() { + return this._categories; }; /** - * Gets the sentCcMe property value. Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. - * @returns a boolean + * Sets the categories property value. Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply. + * @param value Value to set for the categories property. */ - public get sentCcMe() { - return this._sentCcMe; + public set categories(value: string[] | undefined) { + this._categories = value; }; /** - * Gets the sentOnlyToMe property value. Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. - * @returns a boolean + * Instantiates a new messageRulePredicates and sets the default values. */ - public get sentOnlyToMe() { - return this._sentOnlyToMe; + public constructor() { + this._additionalData = new Map(); }; /** - * Gets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. + * Gets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. * @returns a recipient */ - public get sentToAddresses() { - return this._sentToAddresses; - }; - /** - * Gets the sentToMe property value. Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. - * @returns a boolean - */ - public get sentToMe() { - return this._sentToMe; - }; - /** - * Gets the sentToOrCcMe property value. Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. - * @returns a boolean - */ - public get sentToOrCcMe() { - return this._sentToOrCcMe; - }; - /** - * Gets the subjectContains property value. Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. - * @returns a string - */ - public get subjectContains() { - return this._subjectContains; + public get fromAddresses() { + return this._fromAddresses; }; /** - * Gets the withinSizeRange property value. - * @returns a sizeRange + * Sets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. + * @param value Value to set for the fromAddresses property. */ - public get withinSizeRange() { - return this._withinSizeRange; + public set fromAddresses(value: Recipient[] | undefined) { + this._fromAddresses = value; }; /** * The deserialization information for the current model @@ -296,7 +151,7 @@ export class MessageRulePredicates implements Parsable { ["bodyContains", (o, n) => { (o as unknown as MessageRulePredicates).bodyContains = n.getCollectionOfPrimitiveValues(); }], ["bodyOrSubjectContains", (o, n) => { (o as unknown as MessageRulePredicates).bodyOrSubjectContains = n.getCollectionOfPrimitiveValues(); }], ["categories", (o, n) => { (o as unknown as MessageRulePredicates).categories = n.getCollectionOfPrimitiveValues(); }], - ["fromAddresses", (o, n) => { (o as unknown as MessageRulePredicates).fromAddresses = n.getCollectionOfObjectValues(Recipient); }], + ["fromAddresses", (o, n) => { (o as unknown as MessageRulePredicates).fromAddresses = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], ["hasAttachments", (o, n) => { (o as unknown as MessageRulePredicates).hasAttachments = n.getBooleanValue(); }], ["headerContains", (o, n) => { (o as unknown as MessageRulePredicates).headerContains = n.getCollectionOfPrimitiveValues(); }], ["importance", (o, n) => { (o as unknown as MessageRulePredicates).importance = n.getEnumValue(Importance); }], @@ -318,85 +173,19 @@ export class MessageRulePredicates implements Parsable { ["sensitivity", (o, n) => { (o as unknown as MessageRulePredicates).sensitivity = n.getEnumValue(Sensitivity); }], ["sentCcMe", (o, n) => { (o as unknown as MessageRulePredicates).sentCcMe = n.getBooleanValue(); }], ["sentOnlyToMe", (o, n) => { (o as unknown as MessageRulePredicates).sentOnlyToMe = n.getBooleanValue(); }], - ["sentToAddresses", (o, n) => { (o as unknown as MessageRulePredicates).sentToAddresses = n.getCollectionOfObjectValues(Recipient); }], + ["sentToAddresses", (o, n) => { (o as unknown as MessageRulePredicates).sentToAddresses = n.getCollectionOfObjectValues(createRecipientFromDiscriminatorValue); }], ["sentToMe", (o, n) => { (o as unknown as MessageRulePredicates).sentToMe = n.getBooleanValue(); }], ["sentToOrCcMe", (o, n) => { (o as unknown as MessageRulePredicates).sentToOrCcMe = n.getBooleanValue(); }], ["subjectContains", (o, n) => { (o as unknown as MessageRulePredicates).subjectContains = n.getCollectionOfPrimitiveValues(); }], - ["withinSizeRange", (o, n) => { (o as unknown as MessageRulePredicates).withinSizeRange = n.getObjectValue(SizeRange); }], + ["withinSizeRange", (o, n) => { (o as unknown as MessageRulePredicates).withinSizeRange = n.getObjectValue(createSizeRangeFromDiscriminatorValue); }], ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - writer.writeCollectionOfPrimitiveValues("bodyContains", this.bodyContains); - writer.writeCollectionOfPrimitiveValues("bodyOrSubjectContains", this.bodyOrSubjectContains); - writer.writeCollectionOfPrimitiveValues("categories", this.categories); - writer.writeCollectionOfObjectValues("fromAddresses", this.fromAddresses); - writer.writeBooleanValue("hasAttachments", this.hasAttachments); - writer.writeCollectionOfPrimitiveValues("headerContains", this.headerContains); - writer.writeEnumValue("importance", this.importance); - writer.writeBooleanValue("isApprovalRequest", this.isApprovalRequest); - writer.writeBooleanValue("isAutomaticForward", this.isAutomaticForward); - writer.writeBooleanValue("isAutomaticReply", this.isAutomaticReply); - writer.writeBooleanValue("isEncrypted", this.isEncrypted); - writer.writeBooleanValue("isMeetingRequest", this.isMeetingRequest); - writer.writeBooleanValue("isMeetingResponse", this.isMeetingResponse); - writer.writeBooleanValue("isNonDeliveryReport", this.isNonDeliveryReport); - writer.writeBooleanValue("isPermissionControlled", this.isPermissionControlled); - writer.writeBooleanValue("isReadReceipt", this.isReadReceipt); - writer.writeBooleanValue("isSigned", this.isSigned); - writer.writeBooleanValue("isVoicemail", this.isVoicemail); - writer.writeEnumValue("messageActionFlag", this.messageActionFlag); - writer.writeBooleanValue("notSentToMe", this.notSentToMe); - writer.writeCollectionOfPrimitiveValues("recipientContains", this.recipientContains); - writer.writeCollectionOfPrimitiveValues("senderContains", this.senderContains); - writer.writeEnumValue("sensitivity", this.sensitivity); - writer.writeBooleanValue("sentCcMe", this.sentCcMe); - writer.writeBooleanValue("sentOnlyToMe", this.sentOnlyToMe); - writer.writeCollectionOfObjectValues("sentToAddresses", this.sentToAddresses); - writer.writeBooleanValue("sentToMe", this.sentToMe); - writer.writeBooleanValue("sentToOrCcMe", this.sentToOrCcMe); - writer.writeCollectionOfPrimitiveValues("subjectContains", this.subjectContains); - writer.writeObjectValue("withinSizeRange", this.withinSizeRange); - writer.writeAdditionalData(this.additionalData); - }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the bodyContains property value. Represents the strings that should appear in the body of an incoming message in order for the condition or exception to apply. - * @param value Value to set for the bodyContains property. - */ - public set bodyContains(value: string[] | undefined) { - this._bodyContains = value; - }; - /** - * Sets the bodyOrSubjectContains property value. Represents the strings that should appear in the body or subject of an incoming message in order for the condition or exception to apply. - * @param value Value to set for the bodyOrSubjectContains property. - */ - public set bodyOrSubjectContains(value: string[] | undefined) { - this._bodyOrSubjectContains = value; - }; - /** - * Sets the categories property value. Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply. - * @param value Value to set for the categories property. - */ - public set categories(value: string[] | undefined) { - this._categories = value; - }; - /** - * Sets the fromAddresses property value. Represents the specific sender email addresses of an incoming message in order for the condition or exception to apply. - * @param value Value to set for the fromAddresses property. + * Gets the hasAttachments property value. Indicates whether an incoming message must have attachments in order for the condition or exception to apply. + * @returns a boolean */ - public set fromAddresses(value: Recipient[] | undefined) { - this._fromAddresses = value; + public get hasAttachments() { + return this._hasAttachments; }; /** * Sets the hasAttachments property value. Indicates whether an incoming message must have attachments in order for the condition or exception to apply. @@ -405,6 +194,13 @@ export class MessageRulePredicates implements Parsable { public set hasAttachments(value: boolean | undefined) { this._hasAttachments = value; }; + /** + * Gets the headerContains property value. Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. + * @returns a string + */ + public get headerContains() { + return this._headerContains; + }; /** * Sets the headerContains property value. Represents the strings that appear in the headers of an incoming message in order for the condition or exception to apply. * @param value Value to set for the headerContains property. @@ -412,6 +208,13 @@ export class MessageRulePredicates implements Parsable { public set headerContains(value: string[] | undefined) { this._headerContains = value; }; + /** + * Gets the importance property value. + * @returns a importance + */ + public get importance() { + return this._importance; + }; /** * Sets the importance property value. * @param value Value to set for the importance property. @@ -419,6 +222,13 @@ export class MessageRulePredicates implements Parsable { public set importance(value: Importance | undefined) { this._importance = value; }; + /** + * Gets the isApprovalRequest property value. Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. + * @returns a boolean + */ + public get isApprovalRequest() { + return this._isApprovalRequest; + }; /** * Sets the isApprovalRequest property value. Indicates whether an incoming message must be an approval request in order for the condition or exception to apply. * @param value Value to set for the isApprovalRequest property. @@ -426,6 +236,13 @@ export class MessageRulePredicates implements Parsable { public set isApprovalRequest(value: boolean | undefined) { this._isApprovalRequest = value; }; + /** + * Gets the isAutomaticForward property value. Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. + * @returns a boolean + */ + public get isAutomaticForward() { + return this._isAutomaticForward; + }; /** * Sets the isAutomaticForward property value. Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to apply. * @param value Value to set for the isAutomaticForward property. @@ -433,6 +250,13 @@ export class MessageRulePredicates implements Parsable { public set isAutomaticForward(value: boolean | undefined) { this._isAutomaticForward = value; }; + /** + * Gets the isAutomaticReply property value. Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. + * @returns a boolean + */ + public get isAutomaticReply() { + return this._isAutomaticReply; + }; /** * Sets the isAutomaticReply property value. Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. * @param value Value to set for the isAutomaticReply property. @@ -440,6 +264,13 @@ export class MessageRulePredicates implements Parsable { public set isAutomaticReply(value: boolean | undefined) { this._isAutomaticReply = value; }; + /** + * Gets the isEncrypted property value. Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. + * @returns a boolean + */ + public get isEncrypted() { + return this._isEncrypted; + }; /** * Sets the isEncrypted property value. Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. * @param value Value to set for the isEncrypted property. @@ -447,6 +278,13 @@ export class MessageRulePredicates implements Parsable { public set isEncrypted(value: boolean | undefined) { this._isEncrypted = value; }; + /** + * Gets the isMeetingRequest property value. Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. + * @returns a boolean + */ + public get isMeetingRequest() { + return this._isMeetingRequest; + }; /** * Sets the isMeetingRequest property value. Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. * @param value Value to set for the isMeetingRequest property. @@ -454,6 +292,13 @@ export class MessageRulePredicates implements Parsable { public set isMeetingRequest(value: boolean | undefined) { this._isMeetingRequest = value; }; + /** + * Gets the isMeetingResponse property value. Indicates whether an incoming message must be a meeting response in order for the condition or exception to apply. + * @returns a boolean + */ + public get isMeetingResponse() { + return this._isMeetingResponse; + }; /** * Sets the isMeetingResponse property value. Indicates whether an incoming message must be a meeting response in order for the condition or exception to apply. * @param value Value to set for the isMeetingResponse property. @@ -461,6 +306,13 @@ export class MessageRulePredicates implements Parsable { public set isMeetingResponse(value: boolean | undefined) { this._isMeetingResponse = value; }; + /** + * Gets the isNonDeliveryReport property value. Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to apply. + * @returns a boolean + */ + public get isNonDeliveryReport() { + return this._isNonDeliveryReport; + }; /** * Sets the isNonDeliveryReport property value. Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to apply. * @param value Value to set for the isNonDeliveryReport property. @@ -468,6 +320,13 @@ export class MessageRulePredicates implements Parsable { public set isNonDeliveryReport(value: boolean | undefined) { this._isNonDeliveryReport = value; }; + /** + * Gets the isPermissionControlled property value. Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or exception to apply. + * @returns a boolean + */ + public get isPermissionControlled() { + return this._isPermissionControlled; + }; /** * Sets the isPermissionControlled property value. Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or exception to apply. * @param value Value to set for the isPermissionControlled property. @@ -475,6 +334,13 @@ export class MessageRulePredicates implements Parsable { public set isPermissionControlled(value: boolean | undefined) { this._isPermissionControlled = value; }; + /** + * Gets the isReadReceipt property value. Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. + * @returns a boolean + */ + public get isReadReceipt() { + return this._isReadReceipt; + }; /** * Sets the isReadReceipt property value. Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. * @param value Value to set for the isReadReceipt property. @@ -482,6 +348,13 @@ export class MessageRulePredicates implements Parsable { public set isReadReceipt(value: boolean | undefined) { this._isReadReceipt = value; }; + /** + * Gets the isSigned property value. Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. + * @returns a boolean + */ + public get isSigned() { + return this._isSigned; + }; /** * Sets the isSigned property value. Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. * @param value Value to set for the isSigned property. @@ -489,6 +362,13 @@ export class MessageRulePredicates implements Parsable { public set isSigned(value: boolean | undefined) { this._isSigned = value; }; + /** + * Gets the isVoicemail property value. Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. + * @returns a boolean + */ + public get isVoicemail() { + return this._isVoicemail; + }; /** * Sets the isVoicemail property value. Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. * @param value Value to set for the isVoicemail property. @@ -496,6 +376,13 @@ export class MessageRulePredicates implements Parsable { public set isVoicemail(value: boolean | undefined) { this._isVoicemail = value; }; + /** + * Gets the messageActionFlag property value. + * @returns a messageActionFlag + */ + public get messageActionFlag() { + return this._messageActionFlag; + }; /** * Sets the messageActionFlag property value. * @param value Value to set for the messageActionFlag property. @@ -503,6 +390,13 @@ export class MessageRulePredicates implements Parsable { public set messageActionFlag(value: MessageActionFlag | undefined) { this._messageActionFlag = value; }; + /** + * Gets the notSentToMe property value. Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. + * @returns a boolean + */ + public get notSentToMe() { + return this._notSentToMe; + }; /** * Sets the notSentToMe property value. Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the condition or exception to apply. * @param value Value to set for the notSentToMe property. @@ -510,6 +404,13 @@ export class MessageRulePredicates implements Parsable { public set notSentToMe(value: boolean | undefined) { this._notSentToMe = value; }; + /** + * Gets the recipientContains property value. Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. + * @returns a string + */ + public get recipientContains() { + return this._recipientContains; + }; /** * Sets the recipientContains property value. Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message in order for the condition or exception to apply. * @param value Value to set for the recipientContains property. @@ -517,6 +418,13 @@ export class MessageRulePredicates implements Parsable { public set recipientContains(value: string[] | undefined) { this._recipientContains = value; }; + /** + * Gets the senderContains property value. Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. + * @returns a string + */ + public get senderContains() { + return this._senderContains; + }; /** * Sets the senderContains property value. Represents the strings that appear in the from property of an incoming message in order for the condition or exception to apply. * @param value Value to set for the senderContains property. @@ -524,6 +432,13 @@ export class MessageRulePredicates implements Parsable { public set senderContains(value: string[] | undefined) { this._senderContains = value; }; + /** + * Gets the sensitivity property value. + * @returns a sensitivity + */ + public get sensitivity() { + return this._sensitivity; + }; /** * Sets the sensitivity property value. * @param value Value to set for the sensitivity property. @@ -531,6 +446,13 @@ export class MessageRulePredicates implements Parsable { public set sensitivity(value: Sensitivity | undefined) { this._sensitivity = value; }; + /** + * Gets the sentCcMe property value. Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. + * @returns a boolean + */ + public get sentCcMe() { + return this._sentCcMe; + }; /** * Sets the sentCcMe property value. Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order for the condition or exception to apply. * @param value Value to set for the sentCcMe property. @@ -538,6 +460,13 @@ export class MessageRulePredicates implements Parsable { public set sentCcMe(value: boolean | undefined) { this._sentCcMe = value; }; + /** + * Gets the sentOnlyToMe property value. Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. + * @returns a boolean + */ + public get sentOnlyToMe() { + return this._sentOnlyToMe; + }; /** * Sets the sentOnlyToMe property value. Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the condition or exception to apply. * @param value Value to set for the sentOnlyToMe property. @@ -545,6 +474,13 @@ export class MessageRulePredicates implements Parsable { public set sentOnlyToMe(value: boolean | undefined) { this._sentOnlyToMe = value; }; + /** + * Gets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. + * @returns a recipient + */ + public get sentToAddresses() { + return this._sentToAddresses; + }; /** * Sets the sentToAddresses property value. Represents the email addresses that an incoming message must have been sent to in order for the condition or exception to apply. * @param value Value to set for the sentToAddresses property. @@ -552,6 +488,13 @@ export class MessageRulePredicates implements Parsable { public set sentToAddresses(value: Recipient[] | undefined) { this._sentToAddresses = value; }; + /** + * Gets the sentToMe property value. Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. + * @returns a boolean + */ + public get sentToMe() { + return this._sentToMe; + }; /** * Sets the sentToMe property value. Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order for the condition or exception to apply. * @param value Value to set for the sentToMe property. @@ -559,6 +502,13 @@ export class MessageRulePredicates implements Parsable { public set sentToMe(value: boolean | undefined) { this._sentToMe = value; }; + /** + * Gets the sentToOrCcMe property value. Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. + * @returns a boolean + */ + public get sentToOrCcMe() { + return this._sentToOrCcMe; + }; /** * Sets the sentToOrCcMe property value. Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an incoming message in order for the condition or exception to apply. * @param value Value to set for the sentToOrCcMe property. @@ -566,6 +516,51 @@ export class MessageRulePredicates implements Parsable { public set sentToOrCcMe(value: boolean | undefined) { this._sentToOrCcMe = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + writer.writeCollectionOfPrimitiveValues("bodyContains", this.bodyContains); + writer.writeCollectionOfPrimitiveValues("bodyOrSubjectContains", this.bodyOrSubjectContains); + writer.writeCollectionOfPrimitiveValues("categories", this.categories); + writer.writeCollectionOfObjectValues("fromAddresses", this.fromAddresses); + writer.writeBooleanValue("hasAttachments", this.hasAttachments); + writer.writeCollectionOfPrimitiveValues("headerContains", this.headerContains); + writer.writeEnumValue("importance", this.importance); + writer.writeBooleanValue("isApprovalRequest", this.isApprovalRequest); + writer.writeBooleanValue("isAutomaticForward", this.isAutomaticForward); + writer.writeBooleanValue("isAutomaticReply", this.isAutomaticReply); + writer.writeBooleanValue("isEncrypted", this.isEncrypted); + writer.writeBooleanValue("isMeetingRequest", this.isMeetingRequest); + writer.writeBooleanValue("isMeetingResponse", this.isMeetingResponse); + writer.writeBooleanValue("isNonDeliveryReport", this.isNonDeliveryReport); + writer.writeBooleanValue("isPermissionControlled", this.isPermissionControlled); + writer.writeBooleanValue("isReadReceipt", this.isReadReceipt); + writer.writeBooleanValue("isSigned", this.isSigned); + writer.writeBooleanValue("isVoicemail", this.isVoicemail); + writer.writeEnumValue("messageActionFlag", this.messageActionFlag); + writer.writeBooleanValue("notSentToMe", this.notSentToMe); + writer.writeCollectionOfPrimitiveValues("recipientContains", this.recipientContains); + writer.writeCollectionOfPrimitiveValues("senderContains", this.senderContains); + writer.writeEnumValue("sensitivity", this.sensitivity); + writer.writeBooleanValue("sentCcMe", this.sentCcMe); + writer.writeBooleanValue("sentOnlyToMe", this.sentOnlyToMe); + writer.writeCollectionOfObjectValues("sentToAddresses", this.sentToAddresses); + writer.writeBooleanValue("sentToMe", this.sentToMe); + writer.writeBooleanValue("sentToOrCcMe", this.sentToOrCcMe); + writer.writeCollectionOfPrimitiveValues("subjectContains", this.subjectContains); + writer.writeObjectValue("withinSizeRange", this.withinSizeRange); + writer.writeAdditionalData(this.additionalData); + }; + /** + * Gets the subjectContains property value. Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. + * @returns a string + */ + public get subjectContains() { + return this._subjectContains; + }; /** * Sets the subjectContains property value. Represents the strings that appear in the subject of an incoming message in order for the condition or exception to apply. * @param value Value to set for the subjectContains property. @@ -573,6 +568,13 @@ export class MessageRulePredicates implements Parsable { public set subjectContains(value: string[] | undefined) { this._subjectContains = value; }; + /** + * Gets the withinSizeRange property value. + * @returns a sizeRange + */ + public get withinSizeRange() { + return this._withinSizeRange; + }; /** * Sets the withinSizeRange property value. * @param value Value to set for the withinSizeRange property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/multiValueLegacyExtendedProperty.ts b/msgraph-mail/typescript/src/models/microsoft/graph/multiValueLegacyExtendedProperty.ts index 608af0a71..42b947d7d 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/multiValueLegacyExtendedProperty.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/multiValueLegacyExtendedProperty.ts @@ -10,13 +10,6 @@ export class MultiValueLegacyExtendedProperty extends Entity implements Parsable public constructor() { super(); }; - /** - * Gets the value property value. A collection of property values. - * @returns a string - */ - public get value() { - return this._value; - }; /** * The deserialization information for the current model * @returns a Map void> @@ -35,6 +28,13 @@ export class MultiValueLegacyExtendedProperty extends Entity implements Parsable super.serialize(writer); writer.writeCollectionOfPrimitiveValues("value", this.value); }; + /** + * Gets the value property value. A collection of property values. + * @returns a string + */ + public get value() { + return this._value; + }; /** * Sets the value property value. A collection of property values. * @param value Value to set for the value property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/outlookItem.ts b/msgraph-mail/typescript/src/models/microsoft/graph/outlookItem.ts index 55e5bc1e2..34e948f2c 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/outlookItem.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/outlookItem.ts @@ -10,12 +10,6 @@ export class OutlookItem extends Entity implements Parsable { private _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 */ private _lastModifiedDateTime?: Date | undefined; - /** - * Instantiates a new outlookItem and sets the default values. - */ - public constructor() { - super(); - }; /** * Gets the categories property value. The categories associated with the item * @returns a string @@ -23,6 +17,13 @@ export class OutlookItem extends Entity implements Parsable { public get categories() { return this._categories; }; + /** + * Sets the categories property value. The categories associated with the item + * @param value Value to set for the categories property. + */ + public set categories(value: string[] | undefined) { + this._categories = value; + }; /** * Gets the changeKey property value. 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. * @returns a string @@ -30,6 +31,19 @@ export class OutlookItem extends Entity implements Parsable { public get changeKey() { return this._changeKey; }; + /** + * Sets the changeKey property value. 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. + * @param value Value to set for the changeKey property. + */ + public set changeKey(value: string | undefined) { + this._changeKey = value; + }; + /** + * Instantiates a new outlookItem and sets the default values. + */ + public constructor() { + super(); + }; /** * Gets the createdDateTime property value. 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 * @returns a Date @@ -38,11 +52,11 @@ export class OutlookItem extends Entity implements Parsable { return this._createdDateTime; }; /** - * Gets the lastModifiedDateTime property value. 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 - * @returns a Date + * Sets the createdDateTime property value. 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 + * @param value Value to set for the createdDateTime property. */ - public get lastModifiedDateTime() { - return this._lastModifiedDateTime; + public set createdDateTime(value: Date | undefined) { + this._createdDateTime = value; }; /** * The deserialization information for the current model @@ -56,6 +70,20 @@ export class OutlookItem extends Entity implements Parsable { ["lastModifiedDateTime", (o, n) => { (o as unknown as OutlookItem).lastModifiedDateTime = n.getDateValue(); }], ]); }; + /** + * Gets the lastModifiedDateTime property value. 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 + * @returns a Date + */ + public get lastModifiedDateTime() { + return this._lastModifiedDateTime; + }; + /** + * Sets the lastModifiedDateTime property value. 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 + * @param value Value to set for the lastModifiedDateTime property. + */ + public set lastModifiedDateTime(value: Date | undefined) { + this._lastModifiedDateTime = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -68,32 +96,4 @@ export class OutlookItem extends Entity implements Parsable { writer.writeDateValue("createdDateTime", this.createdDateTime); writer.writeDateValue("lastModifiedDateTime", this.lastModifiedDateTime); }; - /** - * Sets the categories property value. The categories associated with the item - * @param value Value to set for the categories property. - */ - public set categories(value: string[] | undefined) { - this._categories = value; - }; - /** - * Sets the changeKey property value. 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. - * @param value Value to set for the changeKey property. - */ - public set changeKey(value: string | undefined) { - this._changeKey = value; - }; - /** - * Sets the createdDateTime property value. 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 - * @param value Value to set for the createdDateTime property. - */ - public set createdDateTime(value: Date | undefined) { - this._createdDateTime = value; - }; - /** - * Sets the lastModifiedDateTime property value. 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 - * @param value Value to set for the lastModifiedDateTime property. - */ - public set lastModifiedDateTime(value: Date | undefined) { - this._lastModifiedDateTime = value; - }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/recipient.ts b/msgraph-mail/typescript/src/models/microsoft/graph/recipient.ts index a9c6b2aff..0d1b80abf 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/recipient.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/recipient.ts @@ -1,3 +1,4 @@ +import {createEmailAddressFromDiscriminatorValue} from './createEmailAddressFromDiscriminatorValue'; import {EmailAddress} from './emailAddress'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -6,18 +7,25 @@ export class Recipient implements Parsable { private _additionalData: Map; private _emailAddress?: EmailAddress | undefined; /** - * Instantiates a new recipient and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; + /** + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. + */ + public set additionalData(value: Map) { + this._additionalData = value; + }; + /** + * Instantiates a new recipient and sets the default values. + */ + public constructor() { + this._additionalData = new Map(); + }; /** * Gets the emailAddress property value. * @returns a emailAddress @@ -25,13 +33,20 @@ export class Recipient implements Parsable { public get emailAddress() { return this._emailAddress; }; + /** + * Sets the emailAddress property value. + * @param value Value to set for the emailAddress property. + */ + public set emailAddress(value: EmailAddress | undefined) { + this._emailAddress = value; + }; /** * The deserialization information for the current model * @returns a Map void> */ public getFieldDeserializers() : Map void> { return new Map void>([ - ["emailAddress", (o, n) => { (o as unknown as Recipient).emailAddress = n.getObjectValue(EmailAddress); }], + ["emailAddress", (o, n) => { (o as unknown as Recipient).emailAddress = n.getObjectValue(createEmailAddressFromDiscriminatorValue); }], ]); }; /** @@ -43,18 +58,4 @@ export class Recipient implements Parsable { writer.writeObjectValue("emailAddress", this.emailAddress); writer.writeAdditionalData(this.additionalData); }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the emailAddress property value. - * @param value Value to set for the emailAddress property. - */ - public set emailAddress(value: EmailAddress | undefined) { - this._emailAddress = value; - }; } diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/singleValueLegacyExtendedProperty.ts b/msgraph-mail/typescript/src/models/microsoft/graph/singleValueLegacyExtendedProperty.ts index a66e235d3..1c3427eb3 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/singleValueLegacyExtendedProperty.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/singleValueLegacyExtendedProperty.ts @@ -10,13 +10,6 @@ export class SingleValueLegacyExtendedProperty extends Entity implements Parsabl public constructor() { super(); }; - /** - * Gets the value property value. A property value. - * @returns a string - */ - public get value() { - return this._value; - }; /** * The deserialization information for the current model * @returns a Map void> @@ -35,6 +28,13 @@ export class SingleValueLegacyExtendedProperty extends Entity implements Parsabl super.serialize(writer); writer.writeStringValue("value", this.value); }; + /** + * Gets the value property value. A property value. + * @returns a string + */ + public get value() { + return this._value; + }; /** * Sets the value property value. A property value. * @param value Value to set for the value property. diff --git a/msgraph-mail/typescript/src/models/microsoft/graph/sizeRange.ts b/msgraph-mail/typescript/src/models/microsoft/graph/sizeRange.ts index 69c65c202..444dae9d0 100644 --- a/msgraph-mail/typescript/src/models/microsoft/graph/sizeRange.ts +++ b/msgraph-mail/typescript/src/models/microsoft/graph/sizeRange.ts @@ -8,31 +8,24 @@ export class SizeRange implements Parsable { /** The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. */ private _minimumSize?: number | undefined; /** - * Instantiates a new sizeRange and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. - * @returns a integer + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get maximumSize() { - return this._maximumSize; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the minimumSize property value. The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. - * @returns a integer + * Instantiates a new sizeRange and sets the default values. */ - public get minimumSize() { - return this._minimumSize; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -45,21 +38,11 @@ export class SizeRange implements Parsable { ]); }; /** - * Serializes information the current object - * @param writer Serialization writer to use to serialize this model - */ - public serialize(writer: SerializationWriter) : void { - if(!writer) throw new Error("writer cannot be undefined"); - writer.writeNumberValue("maximumSize", this.maximumSize); - writer.writeNumberValue("minimumSize", this.minimumSize); - writer.writeAdditionalData(this.additionalData); - }; - /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. + * Gets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. + * @returns a integer */ - public set additionalData(value: Map) { - this._additionalData = value; + public get maximumSize() { + return this._maximumSize; }; /** * Sets the maximumSize property value. The maximum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. @@ -68,6 +51,13 @@ export class SizeRange implements Parsable { public set maximumSize(value: number | undefined) { this._maximumSize = value; }; + /** + * Gets the minimumSize property value. The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. + * @returns a integer + */ + public get minimumSize() { + return this._minimumSize; + }; /** * Sets the minimumSize property value. The minimum size (in kilobytes) that an incoming message must have in order for a condition or exception to apply. * @param value Value to set for the minimumSize property. @@ -75,4 +65,14 @@ export class SizeRange implements Parsable { public set minimumSize(value: number | undefined) { this._minimumSize = value; }; + /** + * Serializes information the current object + * @param writer Serialization writer to use to serialize this model + */ + public serialize(writer: SerializationWriter) : void { + if(!writer) throw new Error("writer cannot be undefined"); + writer.writeNumberValue("maximumSize", this.maximumSize); + writer.writeNumberValue("minimumSize", this.minimumSize); + writer.writeAdditionalData(this.additionalData); + }; } diff --git a/msgraph-mail/typescript/src/users/item/inferenceClassification/inferenceClassificationRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/inferenceClassification/inferenceClassificationRequestBuilder.ts index e3278bd48..85f48d7ea 100644 --- a/msgraph-mail/typescript/src/users/item/inferenceClassification/inferenceClassificationRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/inferenceClassification/inferenceClassificationRequestBuilder.ts @@ -1,7 +1,8 @@ +import {createInferenceClassificationFromDiscriminatorValue} from '../../../models/microsoft/graph/createInferenceClassificationFromDiscriminatorValue'; import {InferenceClassification} from '../../../models/microsoft/graph/inferenceClassification'; -import {InferenceClassificationOverrideRequestBuilder} from './overrides/item/inferenceClassificationOverrideRequestBuilder'; +import {InferenceClassificationOverrideItemRequestBuilder} from './overrides/item/inferenceClassificationOverrideItemRequestBuilder'; import {OverridesRequestBuilder} from './overrides/overridesRequestBuilder'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/inferenceClassification */ export class InferenceClassificationRequestBuilder { @@ -9,7 +10,7 @@ export class InferenceClassificationRequestBuilder { return new OverridesRequestBuilder(this.pathParameters, this.requestAdapter); } /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -19,7 +20,7 @@ export class InferenceClassificationRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification{?select}"; @@ -33,12 +34,12 @@ export class InferenceClassificationRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -51,12 +52,12 @@ export class InferenceClassificationRequestBuilder { */ public createGetRequestInformation(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -68,13 +69,13 @@ export class InferenceClassificationRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: InferenceClassification | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: InferenceClassification | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -85,11 +86,11 @@ export class InferenceClassificationRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. @@ -101,22 +102,22 @@ export class InferenceClassificationRequestBuilder { */ public get(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, InferenceClassification, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createInferenceClassificationFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.inferenceClassification.overrides.item collection * @param id Unique identifier of the item - * @returns a inferenceClassificationOverrideRequestBuilder + * @returns a inferenceClassificationOverrideItemRequestBuilder */ - public overridesById(id: string) : InferenceClassificationOverrideRequestBuilder { + public overridesById(id: string) : InferenceClassificationOverrideItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("inferenceClassificationOverride_id", id); - return new InferenceClassificationOverrideRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["inferenceClassificationOverride_id"] = id + return new InferenceClassificationOverrideItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * Relevance classification of the user's messages based on explicit designations which override inferred relevance or importance. @@ -125,11 +126,11 @@ export class InferenceClassificationRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: InferenceClassification | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: InferenceClassification | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/createOverridesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/createOverridesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..d7c569c71 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/createOverridesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {OverridesResponse} from './overridesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createOverridesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : OverridesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new OverridesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideItemRequestBuilder.ts similarity index 71% rename from msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideItemRequestBuilder.ts index 8b4eceedb..2be812941 100644 --- a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/item/inferenceClassificationOverrideItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createInferenceClassificationOverrideFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue'; import {InferenceClassificationOverride} from '../../../../../models/microsoft/graph/inferenceClassificationOverride'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/inferenceClassification/overrides/{inferenceClassificationOverride-id} */ -export class InferenceClassificationOverrideRequestBuilder { +export class InferenceClassificationOverrideItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new InferenceClassificationOverrideRequestBuilder and sets the default values. + * Instantiates a new InferenceClassificationOverrideItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides/{inferenceClassificationOverride_id}{?select}"; @@ -28,12 +29,12 @@ export class InferenceClassificationOverrideRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -46,12 +47,12 @@ export class InferenceClassificationOverrideRequestBuilder { */ public createGetRequestInformation(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -63,13 +64,13 @@ export class InferenceClassificationOverrideRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: InferenceClassificationOverride | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: InferenceClassificationOverride | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -80,11 +81,11 @@ export class InferenceClassificationOverrideRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -96,11 +97,11 @@ export class InferenceClassificationOverrideRequestBuilder { */ public get(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, InferenceClassificationOverride, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createInferenceClassificationOverrideFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -109,11 +110,11 @@ export class InferenceClassificationOverrideRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: InferenceClassificationOverride | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: InferenceClassificationOverride | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesRequestBuilder.ts index 61af3154b..36162a6dd 100644 --- a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createInferenceClassificationOverrideFromDiscriminatorValue} from '../../../../models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue'; import {InferenceClassificationOverride} from '../../../../models/microsoft/graph/inferenceClassificationOverride'; +import {createOverridesResponseFromDiscriminatorValue} from './createOverridesResponseFromDiscriminatorValue'; import {OverridesResponse} from './overridesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/inferenceClassification/overrides */ export class OverridesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class OverridesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/inferenceClassification/overrides{?top,skip,filter,count,orderby,select}"; @@ -37,12 +39,12 @@ export class OverridesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -54,13 +56,13 @@ export class OverridesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: InferenceClassificationOverride | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: InferenceClassificationOverride | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -80,11 +82,11 @@ export class OverridesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, OverridesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createOverridesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or other. Read-only. Nullable. @@ -94,11 +96,11 @@ export class OverridesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of InferenceClassificationOverride */ - public post(body: InferenceClassificationOverride | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: InferenceClassificationOverride | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, InferenceClassificationOverride, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createInferenceClassificationOverrideFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesResponse.ts b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesResponse.ts index a08b3aa93..b2cddb770 100644 --- a/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/inferenceClassification/overrides/overridesResponse.ts @@ -1,3 +1,4 @@ +import {createInferenceClassificationOverrideFromDiscriminatorValue} from '../../../../models/microsoft/graph/createInferenceClassificationOverrideFromDiscriminatorValue'; import {InferenceClassificationOverride} from '../../../../models/microsoft/graph/inferenceClassificationOverride'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class OverridesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: InferenceClassificationOverride[] | undefined; /** - * Instantiates a new overridesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a inferenceClassificationOverride + * Instantiates a new overridesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class OverridesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as OverridesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as OverridesResponse).value = n.getCollectionOfObjectValues(InferenceClassificationOverride); }], + ["value", (o, n) => { (o as unknown as OverridesResponse).value = n.getCollectionOfObjectValues(createInferenceClassificationOverrideFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class OverridesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a inferenceClassificationOverride */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/createMailFoldersResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/createMailFoldersResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..71097ad60 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/createMailFoldersResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MailFoldersResponse} from './mailFoldersResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMailFoldersResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MailFoldersResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MailFoldersResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersRequestBuilder.ts index 110f1d42a..311fda958 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../../../models/microsoft/graph/mailFolder'; import {ChildFoldersResponse} from './childFoldersResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {createChildFoldersResponseFromDiscriminatorValue} from './createChildFoldersResponseFromDiscriminatorValue'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/childFolders */ export class ChildFoldersRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class ChildFoldersRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders{?top,skip,filter,count,orderby,select,expand}"; @@ -38,12 +40,12 @@ export class ChildFoldersRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class ChildFoldersRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class ChildFoldersRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, ChildFoldersResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createChildFoldersResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of child folders in the mailFolder. @@ -96,11 +98,11 @@ export class ChildFoldersRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MailFolder */ - public post(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MailFolder, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMailFolderFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersResponse.ts index e5986629e..4d396d842 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/childFoldersResponse.ts @@ -1,3 +1,4 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../../../models/microsoft/graph/mailFolder'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class ChildFoldersResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MailFolder[] | undefined; /** - * Instantiates a new childFoldersResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a mailFolder + * Instantiates a new childFoldersResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class ChildFoldersResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as ChildFoldersResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as ChildFoldersResponse).value = n.getCollectionOfObjectValues(MailFolder); }], + ["value", (o, n) => { (o as unknown as ChildFoldersResponse).value = n.getCollectionOfObjectValues(createMailFolderFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class ChildFoldersResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a mailFolder */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/createChildFoldersResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/createChildFoldersResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..125309294 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/createChildFoldersResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {ChildFoldersResponse} from './childFoldersResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createChildFoldersResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ChildFoldersResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new ChildFoldersResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderItemRequestBuilder.ts index 303df3a46..309819fff 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/childFolders/item/mailFolderItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../../../../models/microsoft/graph/mailFolder'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/childFolders/{mailFolder-id1} */ -export class MailFolderRequestBuilder { +export class MailFolderItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new MailFolderRequestBuilder and sets the default values. + * Instantiates a new MailFolderItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/childFolders/{mailFolder_id1}{?select,expand}"; @@ -28,12 +29,12 @@ export class MailFolderRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class MailFolderRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class MailFolderRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class MailFolderRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of child folders in the mailFolder. @@ -98,11 +99,11 @@ export class MailFolderRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MailFolder, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMailFolderFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of child folders in the mailFolder. @@ -111,11 +112,11 @@ export class MailFolderRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderItemRequestBuilder.ts similarity index 65% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderItemRequestBuilder.ts index e8d0126fa..32e8f39ca 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/mailFolderItemRequestBuilder.ts @@ -1,18 +1,19 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../../models/microsoft/graph/mailFolder'; import {ChildFoldersRequestBuilder} from './childFolders/childFoldersRequestBuilder'; -import {MailFolderRequestBuilder as i875c8b38b2223dfa60b331a74c956886fff55439eff296aff4c44c12143b38a8} from './childFolders/item/mailFolderRequestBuilder'; -import {MessageRuleRequestBuilder} from './messageRules/item/messageRuleRequestBuilder'; +import {MailFolderItemRequestBuilder as i9ee0da33ec8428505425bdd040be54e0c25f6d318c11acf219038ed49e484371} from './childFolders/item/mailFolderItemRequestBuilder'; +import {MessageRuleItemRequestBuilder} from './messageRules/item/messageRuleItemRequestBuilder'; import {MessageRulesRequestBuilder} from './messageRules/messageRulesRequestBuilder'; -import {MessageRequestBuilder} from './messages/item/messageRequestBuilder'; +import {MessageItemRequestBuilder} from './messages/item/messageItemRequestBuilder'; import {MessagesRequestBuilder} from './messages/messagesRequestBuilder'; -import {MultiValueLegacyExtendedPropertyRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder'; +import {MultiValueLegacyExtendedPropertyItemRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder'; import {MultiValueExtendedPropertiesRequestBuilder} from './multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder'; -import {SingleValueLegacyExtendedPropertyRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder'; +import {SingleValueLegacyExtendedPropertyItemRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder'; import {SingleValueExtendedPropertiesRequestBuilder} from './singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id} */ -export class MailFolderRequestBuilder { +export class MailFolderItemRequestBuilder { public get childFolders(): ChildFoldersRequestBuilder { return new ChildFoldersRequestBuilder(this.pathParameters, this.requestAdapter); } @@ -26,7 +27,7 @@ export class MailFolderRequestBuilder { return new MultiValueExtendedPropertiesRequestBuilder(this.pathParameters, this.requestAdapter); } /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; public get singleValueExtendedProperties(): SingleValueExtendedPropertiesRequestBuilder { @@ -37,20 +38,20 @@ export class MailFolderRequestBuilder { /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.childFolders.item collection * @param id Unique identifier of the item - * @returns a mailFolderRequestBuilder + * @returns a mailFolderItemRequestBuilder */ - public childFoldersById(id: string) : i875c8b38b2223dfa60b331a74c956886fff55439eff296aff4c44c12143b38a8 { + public childFoldersById(id: string) : i9ee0da33ec8428505425bdd040be54e0c25f6d318c11acf219038ed49e484371 { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("mailFolder_id1", id); - return new i875c8b38b2223dfa60b331a74c956886fff55439eff296aff4c44c12143b38a8(urlTplParams, this.requestAdapter); + urlTplParams["mailFolder_id1"] = id + return new i9ee0da33ec8428505425bdd040be54e0c25f6d318c11acf219038ed49e484371(urlTplParams, this.requestAdapter); }; /** - * Instantiates a new MailFolderRequestBuilder and sets the default values. + * Instantiates a new MailFolderItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}{?select}"; @@ -64,12 +65,12 @@ export class MailFolderRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -82,12 +83,12 @@ export class MailFolderRequestBuilder { */ public createGetRequestInformation(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -99,13 +100,13 @@ export class MailFolderRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -116,11 +117,11 @@ export class MailFolderRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The user's mail folders. Read-only. Nullable. @@ -132,44 +133,44 @@ export class MailFolderRequestBuilder { */ public get(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MailFolder, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMailFolderFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messageRules.item collection * @param id Unique identifier of the item - * @returns a messageRuleRequestBuilder + * @returns a messageRuleItemRequestBuilder */ - public messageRulesById(id: string) : MessageRuleRequestBuilder { + public messageRulesById(id: string) : MessageRuleItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("messageRule_id", id); - return new MessageRuleRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["messageRule_id"] = id + return new MessageRuleItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messages.item collection * @param id Unique identifier of the item - * @returns a messageRequestBuilder + * @returns a messageItemRequestBuilder */ - public messagesById(id: string) : MessageRequestBuilder { + public messagesById(id: string) : MessageItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("message_id", id); - return new MessageRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["message_id"] = id + return new MessageItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a multiValueLegacyExtendedPropertyRequestBuilder + * @returns a multiValueLegacyExtendedPropertyItemRequestBuilder */ - public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyRequestBuilder { + public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["multiValueLegacyExtendedProperty_id"] = id + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * The user's mail folders. Read-only. Nullable. @@ -178,22 +179,22 @@ export class MailFolderRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a singleValueLegacyExtendedPropertyRequestBuilder + * @returns a singleValueLegacyExtendedPropertyItemRequestBuilder */ - public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyRequestBuilder { + public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["singleValueLegacyExtendedProperty_id"] = id + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/createMessageRulesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/createMessageRulesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..6f771e76a --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/createMessageRulesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessageRulesResponse} from './messageRulesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessageRulesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessageRulesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessageRulesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleItemRequestBuilder.ts index 5aee65064..c1a642722 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/item/messageRuleItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createMessageRuleFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createMessageRuleFromDiscriminatorValue'; import {MessageRule} from '../../../../../../models/microsoft/graph/messageRule'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messageRules/{messageRule-id} */ -export class MessageRuleRequestBuilder { +export class MessageRuleItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new MessageRuleRequestBuilder and sets the default values. + * Instantiates a new MessageRuleItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules/{messageRule_id}{?select}"; @@ -28,12 +29,12 @@ export class MessageRuleRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -46,12 +47,12 @@ export class MessageRuleRequestBuilder { */ public createGetRequestInformation(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -63,13 +64,13 @@ export class MessageRuleRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MessageRule | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MessageRule | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -80,11 +81,11 @@ export class MessageRuleRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of rules that apply to the user's Inbox folder. @@ -96,11 +97,11 @@ export class MessageRuleRequestBuilder { */ public get(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MessageRule, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageRuleFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of rules that apply to the user's Inbox folder. @@ -109,11 +110,11 @@ export class MessageRuleRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MessageRule | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MessageRule | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesRequestBuilder.ts index e019aca74..533e2aa4e 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMessageRuleFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMessageRuleFromDiscriminatorValue'; import {MessageRule} from '../../../../../models/microsoft/graph/messageRule'; +import {createMessageRulesResponseFromDiscriminatorValue} from './createMessageRulesResponseFromDiscriminatorValue'; import {MessageRulesResponse} from './messageRulesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messageRules */ export class MessageRulesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MessageRulesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messageRules{?top,skip,filter,count,orderby,select}"; @@ -37,12 +39,12 @@ export class MessageRulesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -54,13 +56,13 @@ export class MessageRulesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MessageRule | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MessageRule | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -80,11 +82,11 @@ export class MessageRulesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MessageRulesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageRulesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of rules that apply to the user's Inbox folder. @@ -94,11 +96,11 @@ export class MessageRulesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MessageRule */ - public post(body: MessageRule | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MessageRule | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MessageRule, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageRuleFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesResponse.ts index f667755a2..751cb4d02 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messageRules/messageRulesResponse.ts @@ -1,3 +1,4 @@ +import {createMessageRuleFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMessageRuleFromDiscriminatorValue'; import {MessageRule} from '../../../../../models/microsoft/graph/messageRule'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MessageRulesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MessageRule[] | undefined; /** - * Instantiates a new messageRulesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a messageRule + * Instantiates a new messageRulesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MessageRulesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MessageRulesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MessageRulesResponse).value = n.getCollectionOfObjectValues(MessageRule); }], + ["value", (o, n) => { (o as unknown as MessageRulesResponse).value = n.getCollectionOfObjectValues(createMessageRuleFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MessageRulesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a messageRule */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/createMessagesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/createMessagesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..52386d082 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/createMessagesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessagesResponse} from './messagesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessagesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessagesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessagesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsRequestBuilder.ts index 9088e46ef..80e99bdf8 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsRequestBuilder.ts @@ -1,11 +1,13 @@ import {Attachment} from '../../../../../../../models/microsoft/graph/attachment'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; import {AttachmentsResponse} from './attachmentsResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {createAttachmentsResponseFromDiscriminatorValue} from './createAttachmentsResponseFromDiscriminatorValue'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/attachments */ export class AttachmentsRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class AttachmentsRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments{?top,skip,filter,count,orderby,select,expand}"; @@ -38,12 +40,12 @@ export class AttachmentsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class AttachmentsRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class AttachmentsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, AttachmentsResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentsResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -96,11 +98,11 @@ export class AttachmentsRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Attachment */ - public post(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Attachment, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsResponse.ts index e49aa45ac..eb0fd65bf 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/attachmentsResponse.ts @@ -1,4 +1,5 @@ import {Attachment} from '../../../../../../../models/microsoft/graph/attachment'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; export class AttachmentsResponse implements Parsable { @@ -7,31 +8,24 @@ export class AttachmentsResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Attachment[] | undefined; /** - * Instantiates a new attachmentsResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a attachment + * Instantiates a new attachmentsResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class AttachmentsResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as AttachmentsResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as AttachmentsResponse).value = n.getCollectionOfObjectValues(Attachment); }], + ["value", (o, n) => { (o as unknown as AttachmentsResponse).value = n.getCollectionOfObjectValues(createAttachmentFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class AttachmentsResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a attachment */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..6aadfd6ec --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {AttachmentsResponse} from './attachmentsResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createAttachmentsResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : AttachmentsResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new AttachmentsResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts index af1a3e0d0..d073d0ea4 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts @@ -1,20 +1,21 @@ import {Attachment} from '../../../../../../../../models/microsoft/graph/attachment'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/attachments/{attachment-id} */ -export class AttachmentRequestBuilder { +export class AttachmentItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new AttachmentRequestBuilder and sets the default values. + * Instantiates a new AttachmentItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class AttachmentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class AttachmentRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class AttachmentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class AttachmentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -98,11 +99,11 @@ export class AttachmentRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Attachment, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -111,11 +112,11 @@ export class AttachmentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..e88cb7b33 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {ExtensionsResponse} from './extensionsResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createExtensionsResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ExtensionsResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new ExtensionsResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsRequestBuilder.ts index ebcd2dfdc..f38ab45e4 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../../../models/microsoft/graph/extension'; +import {createExtensionsResponseFromDiscriminatorValue} from './createExtensionsResponseFromDiscriminatorValue'; import {ExtensionsResponse} from './extensionsResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/extensions */ export class ExtensionsRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class ExtensionsRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions{?top,skip,filter,count,orderby,select,expand}"; @@ -38,12 +40,12 @@ export class ExtensionsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class ExtensionsRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class ExtensionsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, ExtensionsResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionsResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -96,11 +98,11 @@ export class ExtensionsRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Extension */ - public post(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Extension, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsResponse.ts index 42bd7ad79..b476f7366 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/extensionsResponse.ts @@ -1,3 +1,4 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../../../models/microsoft/graph/extension'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class ExtensionsResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Extension[] | undefined; /** - * Instantiates a new extensionsResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a extension + * Instantiates a new extensionsResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class ExtensionsResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as ExtensionsResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as ExtensionsResponse).value = n.getCollectionOfObjectValues(Extension); }], + ["value", (o, n) => { (o as unknown as ExtensionsResponse).value = n.getCollectionOfObjectValues(createExtensionFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class ExtensionsResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a extension */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionItemRequestBuilder.ts index 9d943fe53..5e377a564 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/extensions/item/extensionItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../../../../models/microsoft/graph/extension'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/extensions/{extension-id} */ -export class ExtensionRequestBuilder { +export class ExtensionItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new ExtensionRequestBuilder and sets the default values. + * Instantiates a new ExtensionItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class ExtensionRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class ExtensionRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class ExtensionRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class ExtensionRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -98,11 +99,11 @@ export class ExtensionRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Extension, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -111,11 +112,11 @@ export class ExtensionRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageItemRequestBuilder.ts similarity index 67% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageItemRequestBuilder.ts index 73ba05e8f..fb5f91b40 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/messageItemRequestBuilder.ts @@ -1,17 +1,18 @@ +import {createMessageFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../../../../models/microsoft/graph/message'; import {AttachmentsRequestBuilder} from './attachments/attachmentsRequestBuilder'; -import {AttachmentRequestBuilder} from './attachments/item/attachmentRequestBuilder'; +import {AttachmentItemRequestBuilder} from './attachments/item/attachmentItemRequestBuilder'; import {ExtensionsRequestBuilder} from './extensions/extensionsRequestBuilder'; -import {ExtensionRequestBuilder} from './extensions/item/extensionRequestBuilder'; -import {MultiValueLegacyExtendedPropertyRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder'; +import {ExtensionItemRequestBuilder} from './extensions/item/extensionItemRequestBuilder'; +import {MultiValueLegacyExtendedPropertyItemRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder'; import {MultiValueExtendedPropertiesRequestBuilder} from './multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder'; -import {SingleValueLegacyExtendedPropertyRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder'; +import {SingleValueLegacyExtendedPropertyItemRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder'; import {SingleValueExtendedPropertiesRequestBuilder} from './singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder'; import {ContentRequestBuilder} from './value/contentRequestBuilder'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id} */ -export class MessageRequestBuilder { +export class MessageItemRequestBuilder { public get attachments(): AttachmentsRequestBuilder { return new AttachmentsRequestBuilder(this.pathParameters, this.requestAdapter); } @@ -25,7 +26,7 @@ export class MessageRequestBuilder { return new MultiValueExtendedPropertiesRequestBuilder(this.pathParameters, this.requestAdapter); } /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; public get singleValueExtendedProperties(): SingleValueExtendedPropertiesRequestBuilder { @@ -36,20 +37,20 @@ export class MessageRequestBuilder { /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messages.item.attachments.item collection * @param id Unique identifier of the item - * @returns a attachmentRequestBuilder + * @returns a attachmentItemRequestBuilder */ - public attachmentsById(id: string) : AttachmentRequestBuilder { + public attachmentsById(id: string) : AttachmentItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("attachment_id", id); - return new AttachmentRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["attachment_id"] = id + return new AttachmentItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** - * Instantiates a new MessageRequestBuilder and sets the default values. + * Instantiates a new MessageItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}{?select,expand}"; @@ -63,12 +64,12 @@ export class MessageRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -82,12 +83,12 @@ export class MessageRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -99,13 +100,13 @@ export class MessageRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -116,22 +117,22 @@ export class MessageRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messages.item.extensions.item collection * @param id Unique identifier of the item - * @returns a extensionRequestBuilder + * @returns a extensionItemRequestBuilder */ - public extensionsById(id: string) : ExtensionRequestBuilder { + public extensionsById(id: string) : ExtensionItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("extension_id", id); - return new ExtensionRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["extension_id"] = id + return new ExtensionItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * The collection of messages in the mailFolder. @@ -144,22 +145,22 @@ export class MessageRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Message, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messages.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a multiValueLegacyExtendedPropertyRequestBuilder + * @returns a multiValueLegacyExtendedPropertyItemRequestBuilder */ - public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyRequestBuilder { + public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["multiValueLegacyExtendedProperty_id"] = id + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * The collection of messages in the mailFolder. @@ -168,22 +169,22 @@ export class MessageRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item.messages.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a singleValueLegacyExtendedPropertyRequestBuilder + * @returns a singleValueLegacyExtendedPropertyItemRequestBuilder */ - public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyRequestBuilder { + public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["singleValueLegacyExtendedProperty_id"] = id + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..7a362390f --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MultiValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MultiValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts index 462cf4d83..18f6528bc 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -export class MultiValueLegacyExtendedPropertyRequestBuilder { +export class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -98,11 +99,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -111,11 +112,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts index a3fb8d1f2..6d5744285 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; +import {createMultiValueExtendedPropertiesResponseFromDiscriminatorValue} from './createMultiValueExtendedPropertiesResponseFromDiscriminatorValue'; import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/multiValueExtendedProperties */ export class MultiValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/multiValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -98,11 +100,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MultiValueLegacyExtendedProperty */ - public post(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts index d160f23dd..fe4d95802 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MultiValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a multiValueLegacyExtendedProperty + * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createMultiValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a multiValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..17d6ad98d --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : SingleValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new SingleValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts index 0cefcca3f..b19d0e6b3 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -export class SingleValueLegacyExtendedPropertyRequestBuilder { +export class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -98,11 +99,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -111,11 +112,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts index 5c6e11a39..c5c6e390e 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; +import {createSingleValueExtendedPropertiesResponseFromDiscriminatorValue} from './createSingleValueExtendedPropertiesResponseFromDiscriminatorValue'; import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/singleValueExtendedProperties */ export class SingleValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/singleValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -98,11 +100,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of SingleValueLegacyExtendedProperty */ - public post(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts index 875abb557..50d4260ce 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: SingleValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a singleValueLegacyExtendedProperty + * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createSingleValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a singleValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/value/contentRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/value/contentRequestBuilder.ts index 32fd8e3d8..30818a74a 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/value/contentRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/item/value/contentRequestBuilder.ts @@ -1,10 +1,9 @@ -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; -import {ReadableStream} from 'web-streams-polyfill/es2018'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages/{message-id}/$value */ export class ContentRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -14,7 +13,7 @@ export class ContentRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages/{message_id}/$value"; @@ -28,12 +27,12 @@ export class ContentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createGetRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createGetRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -44,13 +43,13 @@ export class ContentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPutRequestInformation(body: ReadableStream, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPutRequestInformation(body: ArrayBuffer, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PUT; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setStreamContent(body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -60,13 +59,13 @@ export class ContentRequestBuilder { * @param h Request headers * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service - * @returns a Promise of ReadableStream + * @returns a Promise of ArrayBuffer */ - public get(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public get(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( h, o ); - return this.requestAdapter?.sendPrimitiveAsync(requestInfo, "ReadableStream", responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendPrimitiveAsync(requestInfo, "ArrayBuffer", responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Update media content for the navigation property messages in users @@ -75,11 +74,11 @@ export class ContentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public put(body: ReadableStream, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public put(body: ArrayBuffer, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPutRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesRequestBuilder.ts index 66782841a..5dcbf2a72 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMessageFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../../../models/microsoft/graph/message'; +import {createMessagesResponseFromDiscriminatorValue} from './createMessagesResponseFromDiscriminatorValue'; import {MessagesResponse} from './messagesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/messages */ export class MessagesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MessagesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/messages{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class MessagesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class MessagesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class MessagesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MessagesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessagesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of messages in the mailFolder. @@ -98,11 +100,11 @@ export class MessagesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Message */ - public post(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Message, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesResponse.ts index 8592a1770..b224d5ae3 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/messages/messagesResponse.ts @@ -1,3 +1,4 @@ +import {createMessageFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../../../models/microsoft/graph/message'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MessagesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Message[] | undefined; /** - * Instantiates a new messagesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a message + * Instantiates a new messagesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MessagesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MessagesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MessagesResponse).value = n.getCollectionOfObjectValues(Message); }], + ["value", (o, n) => { (o as unknown as MessagesResponse).value = n.getCollectionOfObjectValues(createMessageFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MessagesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a message */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..7a362390f --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MultiValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MultiValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts index 3ca90a648..059c7dd48 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -export class MultiValueLegacyExtendedPropertyRequestBuilder { +export class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -98,11 +99,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -111,11 +112,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts index 6eabb4f5b..9a6ea4062 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; +import {createMultiValueExtendedPropertiesResponseFromDiscriminatorValue} from './createMultiValueExtendedPropertiesResponseFromDiscriminatorValue'; import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/multiValueExtendedProperties */ export class MultiValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/multiValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -98,11 +100,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MultiValueLegacyExtendedProperty */ - public post(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts index 8f5b0323a..f27a5a310 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MultiValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a multiValueLegacyExtendedProperty + * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createMultiValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a multiValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..17d6ad98d --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : SingleValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new SingleValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts index 1431e4abd..e1a01a4d2 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -export class SingleValueLegacyExtendedPropertyRequestBuilder { +export class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -98,11 +99,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -111,11 +112,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts index 8376a7fa8..3cb5f4d9d 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; +import {createSingleValueExtendedPropertiesResponseFromDiscriminatorValue} from './createSingleValueExtendedPropertiesResponseFromDiscriminatorValue'; import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders/{mailFolder-id}/singleValueExtendedProperties */ export class SingleValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders/{mailFolder_id}/singleValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. @@ -98,11 +100,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of SingleValueLegacyExtendedProperty */ - public post(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts index 80b68c5da..4fabe50a3 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: SingleValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a singleValueLegacyExtendedProperty + * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createSingleValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a singleValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersRequestBuilder.ts index 58a3d3acb..b4913cf19 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../models/microsoft/graph/mailFolder'; +import {createMailFoldersResponseFromDiscriminatorValue} from './createMailFoldersResponseFromDiscriminatorValue'; import {MailFoldersResponse} from './mailFoldersResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/mailFolders */ export class MailFoldersRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MailFoldersRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/mailFolders{?top,skip,filter,count,orderby,select}"; @@ -37,12 +39,12 @@ export class MailFoldersRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -54,13 +56,13 @@ export class MailFoldersRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -80,11 +82,11 @@ export class MailFoldersRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MailFoldersResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMailFoldersResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The user's mail folders. Read-only. Nullable. @@ -94,11 +96,11 @@ export class MailFoldersRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MailFolder */ - public post(body: MailFolder | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MailFolder | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MailFolder, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMailFolderFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersResponse.ts b/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersResponse.ts index 5457c96d8..87833422f 100644 --- a/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersResponse.ts +++ b/msgraph-mail/typescript/src/users/item/mailFolders/mailFoldersResponse.ts @@ -1,3 +1,4 @@ +import {createMailFolderFromDiscriminatorValue} from '../../../models/microsoft/graph/createMailFolderFromDiscriminatorValue'; import {MailFolder} from '../../../models/microsoft/graph/mailFolder'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MailFoldersResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MailFolder[] | undefined; /** - * Instantiates a new mailFoldersResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a mailFolder + * Instantiates a new mailFoldersResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MailFoldersResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MailFoldersResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MailFoldersResponse).value = n.getCollectionOfObjectValues(MailFolder); }], + ["value", (o, n) => { (o as unknown as MailFoldersResponse).value = n.getCollectionOfObjectValues(createMailFolderFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MailFoldersResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a mailFolder */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/messages/createMessagesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/messages/createMessagesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..52386d082 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/messages/createMessagesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MessagesResponse} from './messagesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMessagesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MessagesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MessagesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsRequestBuilder.ts index b868a94f6..b88fa20d4 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsRequestBuilder.ts @@ -1,11 +1,13 @@ import {Attachment} from '../../../../../models/microsoft/graph/attachment'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; import {AttachmentsResponse} from './attachmentsResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {createAttachmentsResponseFromDiscriminatorValue} from './createAttachmentsResponseFromDiscriminatorValue'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/attachments */ export class AttachmentsRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class AttachmentsRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments{?top,skip,filter,count,orderby,select,expand}"; @@ -38,12 +40,12 @@ export class AttachmentsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class AttachmentsRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class AttachmentsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, AttachmentsResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentsResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -96,11 +98,11 @@ export class AttachmentsRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Attachment */ - public post(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Attachment, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsResponse.ts b/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsResponse.ts index 76c291c2d..2c094def8 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsResponse.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/attachments/attachmentsResponse.ts @@ -1,4 +1,5 @@ import {Attachment} from '../../../../../models/microsoft/graph/attachment'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; export class AttachmentsResponse implements Parsable { @@ -7,31 +8,24 @@ export class AttachmentsResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Attachment[] | undefined; /** - * Instantiates a new attachmentsResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a attachment + * Instantiates a new attachmentsResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class AttachmentsResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as AttachmentsResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as AttachmentsResponse).value = n.getCollectionOfObjectValues(Attachment); }], + ["value", (o, n) => { (o as unknown as AttachmentsResponse).value = n.getCollectionOfObjectValues(createAttachmentFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class AttachmentsResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a attachment */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..6aadfd6ec --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/messages/item/attachments/createAttachmentsResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {AttachmentsResponse} from './attachmentsResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createAttachmentsResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : AttachmentsResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new AttachmentsResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts index b054c32b5..5487ed772 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/attachments/item/attachmentItemRequestBuilder.ts @@ -1,20 +1,21 @@ import {Attachment} from '../../../../../../models/microsoft/graph/attachment'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {createAttachmentFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createAttachmentFromDiscriminatorValue'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/attachments/{attachment-id} */ -export class AttachmentRequestBuilder { +export class AttachmentItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new AttachmentRequestBuilder and sets the default values. + * Instantiates a new AttachmentItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/attachments/{attachment_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class AttachmentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class AttachmentRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class AttachmentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class AttachmentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -98,11 +99,11 @@ export class AttachmentRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Attachment, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createAttachmentFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The fileAttachment and itemAttachment attachments for the message. @@ -111,11 +112,11 @@ export class AttachmentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Attachment | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Attachment | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..e88cb7b33 --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/messages/item/extensions/createExtensionsResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {ExtensionsResponse} from './extensionsResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createExtensionsResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ExtensionsResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new ExtensionsResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsRequestBuilder.ts index 81e0699aa..d9f7fa94d 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../models/microsoft/graph/extension'; +import {createExtensionsResponseFromDiscriminatorValue} from './createExtensionsResponseFromDiscriminatorValue'; import {ExtensionsResponse} from './extensionsResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/extensions */ export class ExtensionsRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class ExtensionsRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions{?top,skip,filter,count,orderby,select,expand}"; @@ -38,12 +40,12 @@ export class ExtensionsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class ExtensionsRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class ExtensionsRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, ExtensionsResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionsResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -96,11 +98,11 @@ export class ExtensionsRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Extension */ - public post(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Extension, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsResponse.ts b/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsResponse.ts index 31654e4c5..e2a042a28 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsResponse.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/extensions/extensionsResponse.ts @@ -1,3 +1,4 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../models/microsoft/graph/extension'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class ExtensionsResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Extension[] | undefined; /** - * Instantiates a new extensionsResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a extension + * Instantiates a new extensionsResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class ExtensionsResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as ExtensionsResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as ExtensionsResponse).value = n.getCollectionOfObjectValues(Extension); }], + ["value", (o, n) => { (o as unknown as ExtensionsResponse).value = n.getCollectionOfObjectValues(createExtensionFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class ExtensionsResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a extension */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionItemRequestBuilder.ts index a55f4cdd3..67fda68da 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/extensions/item/extensionItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createExtensionFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createExtensionFromDiscriminatorValue'; import {Extension} from '../../../../../../models/microsoft/graph/extension'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/extensions/{extension-id} */ -export class ExtensionRequestBuilder { +export class ExtensionItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new ExtensionRequestBuilder and sets the default values. + * Instantiates a new ExtensionItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/extensions/{extension_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class ExtensionRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class ExtensionRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class ExtensionRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class ExtensionRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -98,11 +99,11 @@ export class ExtensionRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Extension, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createExtensionFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of open extensions defined for the message. Nullable. @@ -111,11 +112,11 @@ export class ExtensionRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Extension | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Extension | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/messageRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/messageItemRequestBuilder.ts similarity index 67% rename from msgraph-mail/typescript/src/users/item/messages/item/messageRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/messages/item/messageItemRequestBuilder.ts index ca4572666..a4da8d062 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/messageRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/messageItemRequestBuilder.ts @@ -1,17 +1,18 @@ +import {createMessageFromDiscriminatorValue} from '../../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../../models/microsoft/graph/message'; import {AttachmentsRequestBuilder} from './attachments/attachmentsRequestBuilder'; -import {AttachmentRequestBuilder} from './attachments/item/attachmentRequestBuilder'; +import {AttachmentItemRequestBuilder} from './attachments/item/attachmentItemRequestBuilder'; import {ExtensionsRequestBuilder} from './extensions/extensionsRequestBuilder'; -import {ExtensionRequestBuilder} from './extensions/item/extensionRequestBuilder'; -import {MultiValueLegacyExtendedPropertyRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder'; +import {ExtensionItemRequestBuilder} from './extensions/item/extensionItemRequestBuilder'; +import {MultiValueLegacyExtendedPropertyItemRequestBuilder} from './multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder'; import {MultiValueExtendedPropertiesRequestBuilder} from './multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder'; -import {SingleValueLegacyExtendedPropertyRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder'; +import {SingleValueLegacyExtendedPropertyItemRequestBuilder} from './singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder'; import {SingleValueExtendedPropertiesRequestBuilder} from './singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder'; import {ContentRequestBuilder} from './value/contentRequestBuilder'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id} */ -export class MessageRequestBuilder { +export class MessageItemRequestBuilder { public get attachments(): AttachmentsRequestBuilder { return new AttachmentsRequestBuilder(this.pathParameters, this.requestAdapter); } @@ -25,7 +26,7 @@ export class MessageRequestBuilder { return new MultiValueExtendedPropertiesRequestBuilder(this.pathParameters, this.requestAdapter); } /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; public get singleValueExtendedProperties(): SingleValueExtendedPropertiesRequestBuilder { @@ -36,20 +37,20 @@ export class MessageRequestBuilder { /** * Gets an item from the graphtypescriptv4.utilities.users.item.messages.item.attachments.item collection * @param id Unique identifier of the item - * @returns a attachmentRequestBuilder + * @returns a attachmentItemRequestBuilder */ - public attachmentsById(id: string) : AttachmentRequestBuilder { + public attachmentsById(id: string) : AttachmentItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("attachment_id", id); - return new AttachmentRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["attachment_id"] = id + return new AttachmentItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** - * Instantiates a new MessageRequestBuilder and sets the default values. + * Instantiates a new MessageItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}{?select}"; @@ -63,12 +64,12 @@ export class MessageRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -81,12 +82,12 @@ export class MessageRequestBuilder { */ public createGetRequestInformation(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -98,13 +99,13 @@ export class MessageRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -115,22 +116,22 @@ export class MessageRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.messages.item.extensions.item collection * @param id Unique identifier of the item - * @returns a extensionRequestBuilder + * @returns a extensionItemRequestBuilder */ - public extensionsById(id: string) : ExtensionRequestBuilder { + public extensionsById(id: string) : ExtensionItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("extension_id", id); - return new ExtensionRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["extension_id"] = id + return new ExtensionItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * The messages in a mailbox or folder. Read-only. Nullable. @@ -142,22 +143,22 @@ export class MessageRequestBuilder { */ public get(q?: { select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Message, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.messages.item.multiValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a multiValueLegacyExtendedPropertyRequestBuilder + * @returns a multiValueLegacyExtendedPropertyItemRequestBuilder */ - public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyRequestBuilder { + public multiValueExtendedPropertiesById(id: string) : MultiValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("multiValueLegacyExtendedProperty_id", id); - return new MultiValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["multiValueLegacyExtendedProperty_id"] = id + return new MultiValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * The messages in a mailbox or folder. Read-only. Nullable. @@ -166,22 +167,22 @@ export class MessageRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.messages.item.singleValueExtendedProperties.item collection * @param id Unique identifier of the item - * @returns a singleValueLegacyExtendedPropertyRequestBuilder + * @returns a singleValueLegacyExtendedPropertyItemRequestBuilder */ - public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyRequestBuilder { + public singleValueExtendedPropertiesById(id: string) : SingleValueLegacyExtendedPropertyItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("singleValueLegacyExtendedProperty_id", id); - return new SingleValueLegacyExtendedPropertyRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["singleValueLegacyExtendedProperty_id"] = id + return new SingleValueLegacyExtendedPropertyItemRequestBuilder(urlTplParams, this.requestAdapter); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..7a362390f --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/createMultiValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createMultiValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : MultiValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new MultiValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts index 5d930e742..340762172 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/item/multiValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty-id} */ -export class MultiValueLegacyExtendedPropertyRequestBuilder { +export class MultiValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new MultiValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new MultiValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties/{multiValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -98,11 +99,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -111,11 +112,11 @@ export class MultiValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts index 7d539e2a3..abb7744e6 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; +import {createMultiValueExtendedPropertiesResponseFromDiscriminatorValue} from './createMultiValueExtendedPropertiesResponseFromDiscriminatorValue'; import {MultiValueExtendedPropertiesResponse} from './multiValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/multiValueExtendedProperties */ export class MultiValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/multiValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of multi-value extended properties defined for the message. Nullable. @@ -98,11 +100,11 @@ export class MultiValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of MultiValueLegacyExtendedProperty */ - public post(body: MultiValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: MultiValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MultiValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMultiValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts index 8f5b0323a..f27a5a310 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/multiValueExtendedProperties/multiValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createMultiValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createMultiValueLegacyExtendedPropertyFromDiscriminatorValue'; import {MultiValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/multiValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: MultiValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a multiValueLegacyExtendedProperty + * Instantiates a new multiValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(MultiValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as MultiValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createMultiValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MultiValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a multiValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts new file mode 100644 index 000000000..17d6ad98d --- /dev/null +++ b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/createSingleValueExtendedPropertiesResponseFromDiscriminatorValue.ts @@ -0,0 +1,7 @@ +import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; +import {ParseNode} from '@microsoft/kiota-abstractions'; + +export function createSingleValueExtendedPropertiesResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : SingleValueExtendedPropertiesResponse { + if(!parseNode) throw new Error("parseNode cannot be undefined"); + return new SingleValueExtendedPropertiesResponse(); +} diff --git a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts similarity index 70% rename from msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts index 95addb22e..f2085aa70 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/item/singleValueLegacyExtendedPropertyItemRequestBuilder.ts @@ -1,20 +1,21 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty-id} */ -export class SingleValueLegacyExtendedPropertyRequestBuilder { +export class SingleValueLegacyExtendedPropertyItemRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new SingleValueLegacyExtendedPropertyRequestBuilder and sets the default values. + * Instantiates a new SingleValueLegacyExtendedPropertyItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties/{singleValueLegacyExtendedProperty_id}{?select,expand}"; @@ -28,12 +29,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createDeleteRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createDeleteRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.DELETE; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -47,12 +48,12 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public createGetRequestInformation(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -64,13 +65,13 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPatchRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PATCH; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -81,11 +82,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public delete(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public delete(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createDeleteRequestInformation( h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -98,11 +99,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { public get(q?: { expand?: string[], select?: string[] - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -111,11 +112,11 @@ export class SingleValueLegacyExtendedPropertyRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public patch(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPatchRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts index 5cedeae75..3a0b4db82 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; +import {createSingleValueExtendedPropertiesResponseFromDiscriminatorValue} from './createSingleValueExtendedPropertiesResponseFromDiscriminatorValue'; import {SingleValueExtendedPropertiesResponse} from './singleValueExtendedPropertiesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/singleValueExtendedProperties */ export class SingleValueExtendedPropertiesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/singleValueExtendedProperties{?top,skip,search,filter,count,orderby,select,expand}"; @@ -39,12 +41,12 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -56,13 +58,13 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -84,11 +86,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueExtendedPropertiesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueExtendedPropertiesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The collection of single-value extended properties defined for the message. Nullable. @@ -98,11 +100,11 @@ export class SingleValueExtendedPropertiesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of SingleValueLegacyExtendedProperty */ - public post(body: SingleValueLegacyExtendedProperty | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: SingleValueLegacyExtendedProperty | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, SingleValueLegacyExtendedProperty, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createSingleValueLegacyExtendedPropertyFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts index 80b68c5da..4fabe50a3 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/singleValueExtendedProperties/singleValueExtendedPropertiesResponse.ts @@ -1,3 +1,4 @@ +import {createSingleValueLegacyExtendedPropertyFromDiscriminatorValue} from '../../../../../models/microsoft/graph/createSingleValueLegacyExtendedPropertyFromDiscriminatorValue'; import {SingleValueLegacyExtendedProperty} from '../../../../../models/microsoft/graph/singleValueLegacyExtendedProperty'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: SingleValueLegacyExtendedProperty[] | undefined; /** - * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a singleValueLegacyExtendedProperty + * Instantiates a new singleValueExtendedPropertiesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(SingleValueLegacyExtendedProperty); }], + ["value", (o, n) => { (o as unknown as SingleValueExtendedPropertiesResponse).value = n.getCollectionOfObjectValues(createSingleValueLegacyExtendedPropertyFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class SingleValueExtendedPropertiesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a singleValueLegacyExtendedProperty */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/messages/item/value/contentRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/item/value/contentRequestBuilder.ts index 15f595ee0..806f1ff1b 100644 --- a/msgraph-mail/typescript/src/users/item/messages/item/value/contentRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/item/value/contentRequestBuilder.ts @@ -1,10 +1,9 @@ -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; -import {ReadableStream} from 'web-streams-polyfill/es2018'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages/{message-id}/$value */ export class ContentRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -14,7 +13,7 @@ export class ContentRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages/{message_id}/$value"; @@ -28,12 +27,12 @@ export class ContentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createGetRequestInformation(h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createGetRequestInformation(h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; o && requestInfo.addRequestOptions(...o); return requestInfo; }; @@ -44,13 +43,13 @@ export class ContentRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPutRequestInformation(body: ReadableStream, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPutRequestInformation(body: ArrayBuffer, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.PUT; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setStreamContent(body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -60,13 +59,13 @@ export class ContentRequestBuilder { * @param h Request headers * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service - * @returns a Promise of ReadableStream + * @returns a Promise of ArrayBuffer */ - public get(h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public get(h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( h, o ); - return this.requestAdapter?.sendPrimitiveAsync(requestInfo, "ReadableStream", responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendPrimitiveAsync(requestInfo, "ArrayBuffer", responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * Update media content for the navigation property messages in users @@ -75,11 +74,11 @@ export class ContentRequestBuilder { * @param o Request options * @param responseHandler Response handler to use in place of the default response handling provided by the core service */ - public put(body: ReadableStream, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public put(body: ArrayBuffer, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPutRequestInformation( body, h, o ); - return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/messagesRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/messages/messagesRequestBuilder.ts index 5e41a51f7..35026c809 100644 --- a/msgraph-mail/typescript/src/users/item/messages/messagesRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/messages/messagesRequestBuilder.ts @@ -1,11 +1,13 @@ +import {createMessageFromDiscriminatorValue} from '../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../models/microsoft/graph/message'; +import {createMessagesResponseFromDiscriminatorValue} from './createMessagesResponseFromDiscriminatorValue'; import {MessagesResponse} from './messagesResponse'; -import {getPathParameters, HttpMethod, Parsable, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; +import {getPathParameters, HttpMethod, Parsable, ParsableFactory, RequestAdapter, RequestInformation, RequestOption, ResponseHandler} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id}/messages */ export class MessagesRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -15,7 +17,7 @@ export class MessagesRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}/messages{?top,skip,search,filter,count,orderby,select}"; @@ -38,12 +40,12 @@ export class MessagesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.GET; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; q && requestInfo.setQueryStringParametersFromRawObject(q); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -55,13 +57,13 @@ export class MessagesRequestBuilder { * @param o Request options * @returns a RequestInformation */ - public createPostRequestInformation(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined) : RequestInformation { + public createPostRequestInformation(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined) : RequestInformation { if(!body) throw new Error("body cannot be undefined"); const requestInfo = new RequestInformation(); requestInfo.urlTemplate = this.urlTemplate; requestInfo.pathParameters = this.pathParameters; requestInfo.httpMethod = HttpMethod.POST; - h && requestInfo.setHeadersFromRawObject(h); + if(h) requestInfo.headers = h; requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body); o && requestInfo.addRequestOptions(...o); return requestInfo; @@ -82,11 +84,11 @@ export class MessagesRequestBuilder { select?: string[], skip?: number, top?: number - } | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + } | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { const requestInfo = this.createGetRequestInformation( q, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, MessagesResponse, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessagesResponseFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; /** * The messages in a mailbox or folder. Read-only. Nullable. @@ -96,11 +98,11 @@ export class MessagesRequestBuilder { * @param responseHandler Response handler to use in place of the default response handling provided by the core service * @returns a Promise of Message */ - public post(body: Message | undefined, h?: object | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { + public post(body: Message | undefined, h?: Record | undefined, o?: RequestOption[] | undefined, responseHandler?: ResponseHandler | undefined) : Promise { if(!body) throw new Error("body cannot be undefined"); const requestInfo = this.createPostRequestInformation( body, h, o ); - return this.requestAdapter?.sendAsync(requestInfo, Message, responseHandler) ?? Promise.reject(new Error('http core is null')); + return this.requestAdapter?.sendAsync(requestInfo, createMessageFromDiscriminatorValue, responseHandler, undefined) ?? Promise.reject(new Error('http core is null')); }; } diff --git a/msgraph-mail/typescript/src/users/item/messages/messagesResponse.ts b/msgraph-mail/typescript/src/users/item/messages/messagesResponse.ts index e767bea24..e7606006d 100644 --- a/msgraph-mail/typescript/src/users/item/messages/messagesResponse.ts +++ b/msgraph-mail/typescript/src/users/item/messages/messagesResponse.ts @@ -1,3 +1,4 @@ +import {createMessageFromDiscriminatorValue} from '../../../models/microsoft/graph/createMessageFromDiscriminatorValue'; import {Message} from '../../../models/microsoft/graph/message'; import {Parsable, ParseNode, SerializationWriter} from '@microsoft/kiota-abstractions'; @@ -7,31 +8,24 @@ export class MessagesResponse implements Parsable { private _nextLink?: string | undefined; private _value?: Message[] | undefined; /** - * Instantiates a new messagesResponse and sets the default values. - */ - public constructor() { - this._additionalData = new Map(); - }; - /** - * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @returns a Map */ public get additionalData() { return this._additionalData; }; /** - * Gets the nextLink property value. - * @returns a string + * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + * @param value Value to set for the AdditionalData property. */ - public get nextLink() { - return this._nextLink; + public set additionalData(value: Map) { + this._additionalData = value; }; /** - * Gets the value property value. - * @returns a message + * Instantiates a new messagesResponse and sets the default values. */ - public get value() { - return this._value; + public constructor() { + this._additionalData = new Map(); }; /** * The deserialization information for the current model @@ -40,9 +34,23 @@ export class MessagesResponse implements Parsable { public getFieldDeserializers() : Map void> { return new Map void>([ ["@odata.nextLink", (o, n) => { (o as unknown as MessagesResponse).nextLink = n.getStringValue(); }], - ["value", (o, n) => { (o as unknown as MessagesResponse).value = n.getCollectionOfObjectValues(Message); }], + ["value", (o, n) => { (o as unknown as MessagesResponse).value = n.getCollectionOfObjectValues(createMessageFromDiscriminatorValue); }], ]); }; + /** + * Gets the @odata.nextLink property value. + * @returns a string + */ + public get nextLink() { + return this._nextLink; + }; + /** + * Sets the @odata.nextLink property value. + * @param value Value to set for the nextLink property. + */ + public set nextLink(value: string | undefined) { + this._nextLink = value; + }; /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model @@ -54,18 +62,11 @@ export class MessagesResponse implements Parsable { writer.writeAdditionalData(this.additionalData); }; /** - * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - * @param value Value to set for the AdditionalData property. - */ - public set additionalData(value: Map) { - this._additionalData = value; - }; - /** - * Sets the nextLink property value. - * @param value Value to set for the nextLink property. + * Gets the value property value. + * @returns a message */ - public set nextLink(value: string | undefined) { - this._nextLink = value; + public get value() { + return this._value; }; /** * Sets the value property value. diff --git a/msgraph-mail/typescript/src/users/item/userRequestBuilder.ts b/msgraph-mail/typescript/src/users/item/userItemRequestBuilder.ts similarity index 71% rename from msgraph-mail/typescript/src/users/item/userRequestBuilder.ts rename to msgraph-mail/typescript/src/users/item/userItemRequestBuilder.ts index ad852de02..468905b3e 100644 --- a/msgraph-mail/typescript/src/users/item/userRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/item/userItemRequestBuilder.ts @@ -1,12 +1,12 @@ import {InferenceClassificationRequestBuilder} from './inferenceClassification/inferenceClassificationRequestBuilder'; -import {MailFolderRequestBuilder} from './mailFolders/item/mailFolderRequestBuilder'; +import {MailFolderItemRequestBuilder} from './mailFolders/item/mailFolderItemRequestBuilder'; import {MailFoldersRequestBuilder} from './mailFolders/mailFoldersRequestBuilder'; -import {MessageRequestBuilder} from './messages/item/messageRequestBuilder'; +import {MessageItemRequestBuilder} from './messages/item/messageItemRequestBuilder'; import {MessagesRequestBuilder} from './messages/messagesRequestBuilder'; import {getPathParameters, RequestAdapter} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users/{user-id} */ -export class UserRequestBuilder { +export class UserItemRequestBuilder { public get inferenceClassification(): InferenceClassificationRequestBuilder { return new InferenceClassificationRequestBuilder(this.pathParameters, this.requestAdapter); } @@ -17,17 +17,17 @@ export class UserRequestBuilder { return new MessagesRequestBuilder(this.pathParameters, this.requestAdapter); } /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ private readonly urlTemplate: string; /** - * Instantiates a new UserRequestBuilder and sets the default values. + * Instantiates a new UserItemRequestBuilder and sets the default values. * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users/{user_id}"; @@ -38,23 +38,23 @@ export class UserRequestBuilder { /** * Gets an item from the graphtypescriptv4.utilities.users.item.mailFolders.item collection * @param id Unique identifier of the item - * @returns a mailFolderRequestBuilder + * @returns a mailFolderItemRequestBuilder */ - public mailFoldersById(id: string) : MailFolderRequestBuilder { + public mailFoldersById(id: string) : MailFolderItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("mailFolder_id", id); - return new MailFolderRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["mailFolder_id"] = id + return new MailFolderItemRequestBuilder(urlTplParams, this.requestAdapter); }; /** * Gets an item from the graphtypescriptv4.utilities.users.item.messages.item collection * @param id Unique identifier of the item - * @returns a messageRequestBuilder + * @returns a messageItemRequestBuilder */ - public messagesById(id: string) : MessageRequestBuilder { + public messagesById(id: string) : MessageItemRequestBuilder { if(!id) throw new Error("id cannot be undefined"); const urlTplParams = getPathParameters(this.pathParameters); - id && urlTplParams.set("message_id", id); - return new MessageRequestBuilder(urlTplParams, this.requestAdapter); + urlTplParams["message_id"] = id + return new MessageItemRequestBuilder(urlTplParams, this.requestAdapter); }; } diff --git a/msgraph-mail/typescript/src/users/usersRequestBuilder.ts b/msgraph-mail/typescript/src/users/usersRequestBuilder.ts index c8bf72076..4f136e8d7 100644 --- a/msgraph-mail/typescript/src/users/usersRequestBuilder.ts +++ b/msgraph-mail/typescript/src/users/usersRequestBuilder.ts @@ -3,7 +3,7 @@ import {getPathParameters, RequestAdapter} from '@microsoft/kiota-abstractions'; /** Builds and executes requests for operations under /users */ export class UsersRequestBuilder { /** Path parameters for the request */ - private readonly pathParameters: Map; + private readonly pathParameters: Record; /** The request adapter to use to execute the requests. */ private readonly requestAdapter: RequestAdapter; /** Url template to use to build the URL for the current request builder */ @@ -13,7 +13,7 @@ export class UsersRequestBuilder { * @param pathParameters The raw url or the Url template parameters for the request. * @param requestAdapter The request adapter to use to execute the requests. */ - public constructor(pathParameters: Map | string | undefined, requestAdapter: RequestAdapter) { + public constructor(pathParameters: Record | string | undefined, requestAdapter: RequestAdapter) { if(!pathParameters) throw new Error("pathParameters cannot be undefined"); if(!requestAdapter) throw new Error("requestAdapter cannot be undefined"); this.urlTemplate = "{+baseurl}/users";