Skip to content

Commit

Permalink
Merge pull request #2293 from microsoftgraph/dev
Browse files Browse the repository at this point in the history
Release 5.39.0
  • Loading branch information
andrueastman authored Jan 17, 2024
2 parents d784cbf + 2821a5d commit 5aa70b4
Show file tree
Hide file tree
Showing 164 changed files with 3,120 additions and 423 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

## [Unreleased]

## [5.39.0] - 2024-01-16

- Latest metadata updates from 16th January 2024.
- Fixes missing interfaces for changenotification models(https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2237).

## [5.38.0] - 2024-01-03

- Latest metadata updates from 2nd January 2024.
Expand Down
43 changes: 43 additions & 0 deletions docs/upgrade-to-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,49 @@ var groups = await graphServiceClient
});
```

### Query Parameter Values

Standard Query parameters such as `Select`, `Search` or `Filter` now uses the OData standard with the `$` prefix.

This can break your requests if you do not adapt your parameter values to take this into account.

Example for SharePoint searches:

```cs
//Valid
var sites = await graphServiceClient
.Sites
.GetAsync(requestConfiguration =>
{
requestConfiguration.QueryParameters.Search = "\"a1\""; //Quotes are escaped
});

//Invalid
var sites = await graphServiceClient
.Sites
.GetAsync(requestConfiguration =>
{
requestConfiguration.QueryParameters.Search = "a1"; // Numbers not accepted without quotes in $search. Returns an OData exception.
});

//Valid
var allSites = await graphServiceClient
.Sites
.GetAsync(requestConfiguration =>
{
requestConfiguration.QueryParameters.Search = "\"id=*\""; // Select all on the id property
});

//Invalid
var allSites = await graphServiceClient
.Sites
.GetAsync(requestConfiguration =>
{
requestConfiguration.QueryParameters.Search = "\"*\""; // $search="*" returns an empty array
});
```
To make sure that your conversion is correct verify your query parameters in the [Microsoft Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer) before running your code. Also make sure that special characters are either **escaped** or **URL encoded**.

### Per-Request Options
To pass per-request options to the default http middleware to configure actions like redirects and retries, this can be done using the `requestConfiguration` by adding an `IRequestOption` instance to the `Options` collection. For example, adding a `RetryHandlerOption` instance to configure the retry handler option as below.

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Graph/Extensions/ChangeNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System;
namespace Microsoft.Graph.Models {
public class ChangeNotification : IAdditionalDataHolder, IBackedModel, IParsable {
public class ChangeNotification : IEncryptedContentBearer<ChangeNotificationEncryptedContent>,IAdditionalDataHolder, IBackedModel, IParsable {
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData {
get { return BackingStore?.Get<IDictionary<string, object>>("additionalData"); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
using Microsoft.Kiota.Abstractions.Store;

namespace Microsoft.Graph.Models {
public class ChangeNotificationCollection : IAdditionalDataHolder,IBackedModel, IParsable {
public class ChangeNotificationCollection : ITokenValidable<ChangeNotification, ChangeNotificationEncryptedContent>, IAdditionalDataHolder,IBackedModel, IParsable {
/// <summary>Stores model information.</summary>
public IBackingStore BackingStore { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System;
namespace Microsoft.Graph.Models {
public class ChangeNotificationEncryptedContent : IAdditionalDataHolder, IBackedModel, IParsable {
public class ChangeNotificationEncryptedContent : IDecryptableContent, IAdditionalDataHolder, IBackedModel, IParsable {
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData {
get { return BackingStore?.Get<IDictionary<string, object>>("additionalData"); }
Expand Down
33 changes: 33 additions & 0 deletions src/Microsoft.Graph/Extensions/SubscriptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Graph;

namespace Microsoft.Graph.Models
{
public static class SubscriptionExtensions
{
/// <summary>
/// Adds the public encryption certificate information for change notifications with resource data to the subscription creation information.
/// </summary>
/// <param name="subscription">The subscription instance of type <see cref="Subscription"/></param>
/// <param name="certificate">Certificate to use for encryption</param>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="certificate"/> is null</exception>
public static void AddPublicEncryptionCertificate(this Subscription subscription, X509Certificate2 certificate)
{
if (certificate == null)
throw new ArgumentNullException(nameof(certificate));

var tempSubscription = new EncryptableSubscription();
tempSubscription.AddPublicEncryptionCertificate(certificate);
subscription.EncryptionCertificate = tempSubscription.EncryptionCertificate;
}
}

internal class EncryptableSubscription : IEncryptableSubscription
{
/// <summary>
/// The encryption certificate
/// </summary>
public string EncryptionCertificate { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Retrieve a conversationMember from a chat or channel.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0" />
/// Retrieve a conversationMember from a chat.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0" />
/// </summary>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand Down Expand Up @@ -106,7 +106,7 @@ public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration
return requestInfo;
}
/// <summary>
/// Retrieve a conversationMember from a chat or channel.
/// Retrieve a conversationMember from a chat.
/// </summary>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -154,7 +154,7 @@ public ConversationMemberItemRequestBuilder WithUrl(string rawUrl) {
public class ConversationMemberItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration<DefaultQueryParameters> {
}
/// <summary>
/// Retrieve a conversationMember from a chat or channel.
/// Retrieve a conversationMember from a chat.
/// </summary>
public class ConversationMemberItemRequestBuilderGetQueryParameters {
/// <summary>Expand related entities</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public async Task<ChatMessageCollectionResponse> GetAsync(Action<RequestConfigur
return await RequestAdapter.SendAsync<ChatMessageCollectionResponse>(requestInfo, ChatMessageCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Send a new chatMessage in the specified chat. This API can&apos;t create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0" />
/// Send a new chatMessage in the specified channel or a chat.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/chatmessage-post?view=graph-rest-1.0" />
/// </summary>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down Expand Up @@ -105,7 +105,7 @@ public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<Me
return requestInfo;
}
/// <summary>
/// Send a new chatMessage in the specified chat. This API can&apos;t create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
/// Send a new chatMessage in the specified channel or a chat.
/// </summary>
/// <param name="body">The request body</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ public TeamworkNotificationRecipient Recipient {
get { return BackingStore?.Get<TeamworkNotificationRecipient>("recipient"); }
set { BackingStore?.Set("recipient", value); }
}
#endif
/// <summary>The teamsAppId property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? TeamsAppId {
get { return BackingStore?.Get<string?>("teamsAppId"); }
set { BackingStore?.Set("teamsAppId", value); }
}
#nullable restore
#else
public string TeamsAppId {
get { return BackingStore?.Get<string>("teamsAppId"); }
set { BackingStore?.Set("teamsAppId", value); }
}
#endif
/// <summary>The templateParameters property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -114,6 +128,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
{"chainId", n => { ChainId = n.GetLongValue(); } },
{"previewText", n => { PreviewText = n.GetObjectValue<ItemBody>(ItemBody.CreateFromDiscriminatorValue); } },
{"recipient", n => { Recipient = n.GetObjectValue<TeamworkNotificationRecipient>(TeamworkNotificationRecipient.CreateFromDiscriminatorValue); } },
{"teamsAppId", n => { TeamsAppId = n.GetStringValue(); } },
{"templateParameters", n => { TemplateParameters = n.GetCollectionOfObjectValues<Microsoft.Graph.Models.KeyValuePair>(Microsoft.Graph.Models.KeyValuePair.CreateFromDiscriminatorValue)?.ToList(); } },
{"topic", n => { Topic = n.GetObjectValue<TeamworkActivityTopic>(TeamworkActivityTopic.CreateFromDiscriminatorValue); } },
};
Expand All @@ -128,6 +143,7 @@ public virtual void Serialize(ISerializationWriter writer) {
writer.WriteLongValue("chainId", ChainId);
writer.WriteObjectValue<ItemBody>("previewText", PreviewText);
writer.WriteObjectValue<TeamworkNotificationRecipient>("recipient", Recipient);
writer.WriteStringValue("teamsAppId", TeamsAppId);
writer.WriteCollectionOfObjectValues<Microsoft.Graph.Models.KeyValuePair>("templateParameters", TemplateParameters);
writer.WriteObjectValue<TeamworkActivityTopic>("topic", Topic);
writer.WriteAdditionalData(AdditionalData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public InviteRequestBuilder(Dictionary<string, object> pathParameters, IRequestA
public InviteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/communications/calls/{call%2Did}/participants/invite", rawUrl) {
}
/// <summary>
/// Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/participant-delete?view=graph-rest-1.0" />
/// Invite participants to the active call. For more information about how to handle operations, see commsOperation.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/participant-invite?view=graph-rest-1.0" />
/// </summary>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand All @@ -51,7 +51,7 @@ public async Task<InviteParticipantsOperation> PostAsync(InvitePostRequestBody b
return await RequestAdapter.SendAsync<InviteParticipantsOperation>(requestInfo, InviteParticipantsOperation.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
/// Invite participants to the active call. For more information about how to handle operations, see commsOperation.
/// </summary>
/// <param name="body">The request body</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public DeviceAppManagementRequestBuilder(string rawUrl, IRequestAdapter requestA
}
/// <summary>
/// Read properties and relationships of the deviceAppManagement object.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-partnerintegration-deviceappmanagement-get?view=graph-rest-1.0" />
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-onboarding-deviceappmanagement-get?view=graph-rest-1.0" />
/// </summary>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand All @@ -125,7 +125,7 @@ public DeviceAppManagementRequestBuilder(string rawUrl, IRequestAdapter requestA
}
/// <summary>
/// Update the properties of a deviceAppManagement object.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-onboarding-deviceappmanagement-update?view=graph-rest-1.0" />
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-policyset-deviceappmanagement-update?view=graph-rest-1.0" />
/// </summary>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Read properties and relationships of the managedAppProtection object.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-get?view=graph-rest-1.0" />
/// Read properties and relationships of the managedAppConfiguration object.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-mam-managedappconfiguration-get?view=graph-rest-1.0" />
/// </summary>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand Down Expand Up @@ -110,7 +110,7 @@ public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration
return requestInfo;
}
/// <summary>
/// Read properties and relationships of the managedAppProtection object.
/// Read properties and relationships of the managedAppConfiguration object.
/// </summary>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -158,7 +158,7 @@ public ManagedAppPolicyItemRequestBuilder WithUrl(string rawUrl) {
public class ManagedAppPolicyItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration<DefaultQueryParameters> {
}
/// <summary>
/// Read properties and relationships of the managedAppProtection object.
/// Read properties and relationships of the managedAppConfiguration object.
/// </summary>
public class ManagedAppPolicyItemRequestBuilderGetQueryParameters {
/// <summary>Expand related entities</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TargetAppsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
}
/// <summary>
/// Not yet documented
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-targetapps?view=graph-rest-1.0" />
/// Find more info here <see href="https://learn.microsoft.com/graph/api/intune-mam-managedapppolicy-targetapps?view=graph-rest-1.0" />
/// </summary>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
Expand Down
Loading

0 comments on commit 5aa70b4

Please sign in to comment.