Skip to content

Commit

Permalink
Merge pull request #2315 from microsoftgraph/dev
Browse files Browse the repository at this point in the history
Release 5.41.0
  • Loading branch information
andrueastman authored Feb 1, 2024
2 parents 73b1107 + 9ea813a commit d817c16
Show file tree
Hide file tree
Showing 221 changed files with 2,690 additions and 1,380 deletions.
15 changes: 10 additions & 5 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.41.0] - 2024-01-31

- Latest metadata updates from 30th January 2024.
- Fixes DateTimeTimeZone.ToDateTime returning incorrect parsed date(https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2286)

## [5.40.0] - 2024-01-24

- Latest metadata updates from 24th January 2024.
Expand All @@ -32,7 +37,7 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

## [5.35.0] - 2023-11-15

- Fixes `Accept` header values generated by the SDK.
- Fixes `Accept` header values generated by the SDK.
- Latest metadata updates from 14th November 2023.

## [5.33.0] - 2023-11-02
Expand All @@ -41,7 +46,7 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

## [5.32.0] - 2023-10-24

- SDK is compatible with trimming(https://github.com/microsoftgraph/msgraph-sdk-dotnet/pull/2174)
- SDK is compatible with trimming(https://github.com/microsoftgraph/msgraph-sdk-dotnet/pull/2174)
- Latest metadata updates from 24th October 2023.

## [5.31.0] - 2023-10-19
Expand Down Expand Up @@ -77,7 +82,7 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

## [5.25.0] - 2023-08-30

- Add `WithUrl` request builders to allow for easier making of requests with arbitrary Urls(https://github.com/microsoft/kiota/pull/3212)
- Add `WithUrl` request builders to allow for easier making of requests with arbitrary Urls(https://github.com/microsoft/kiota/pull/3212)
- Latest metadata updates from 29th August 2023.

## [5.24.0] - 2023-08-23
Expand Down Expand Up @@ -185,7 +190,7 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

## [5.5.0] - 2023-04-06

### Changed
### Changed

- Fixes missing dateTime query parameters for bookingBusinesses (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1791)
- Fixes missing exapand clauses for calendars and contactFolder (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1788)
Expand Down Expand Up @@ -294,7 +299,7 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v

- Fixes incorrect types for collection types referencing enums - [Kiota #1846](https://github.com/microsoft/kiota/pull/1846)
- Fixes missing return object types for PATCH/POST/PUT calls - https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/issues/478
- Fixes missing QueryParameters for odata functions e.g delta
- Fixes missing QueryParameters for odata functions e.g delta
- Latest metadata updates from 27th September 2022 snapshot

## [5.0.0-preview.11] - 2022-07-20
Expand Down
25 changes: 18 additions & 7 deletions src/Microsoft.Graph/Extensions/DateTimeTimeZoneExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace Microsoft.Graph.Models
{

/// <summary>
/// Implements DateTimeTimeZone Extensions
/// </summary>

public static class DateTimeTimeZoneExtensions
{
internal const string DateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fffffffK";
Expand All @@ -22,26 +22,37 @@ public static class DateTimeTimeZoneExtensions
/// <returns></returns>
public static DateTime ToDateTime(this DateTimeTimeZone dateTimeTimeZone)
{
DateTime dateTime = DateTime.ParseExact(dateTimeTimeZone.DateTime, DateTimeFormat, CultureInfo.InvariantCulture);
DateTime parsedDateTime = DateTime.ParseExact(dateTimeTimeZone.DateTime, DateTimeFormat, CultureInfo.InvariantCulture);

// Now we need to determine which DateTimeKind to set based on the time zone specified in the input object.
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(dateTimeTimeZone.TimeZone);

DateTimeKind kind;
if (timeZoneInfo.Id == TimeZoneInfo.Utc.Id)
if(timeZoneInfo.StandardName == TimeZoneInfo.Utc.StandardName)
{
kind = DateTimeKind.Utc;
// however, if the parsedDateTime.Kind is Local, we need to align to be utc too
if (parsedDateTime.Kind == DateTimeKind.Local)
{
parsedDateTime = parsedDateTime.ToUniversalTime();
}
}
else if (timeZoneInfo.Id == TimeZoneInfo.Local.Id)
else if (timeZoneInfo.StandardName == TimeZoneInfo.Local.StandardName)
{
kind = DateTimeKind.Local;
// however, if the parsedDateTime.Kind is UTC, we need to align it to be local too
if (parsedDateTime.Kind == DateTimeKind.Utc)
{
parsedDateTime = parsedDateTime.ToLocalTime();
}
}
else
{
kind = DateTimeKind.Unspecified;
//if timeZoneInfo passed is not UTC or Local, then it is Unspecified
//Infer from parsedDateTime.Kind rather than blindly set it to Unspecified
kind = parsedDateTime.Kind;
}

return DateTime.SpecifyKind(dateTime, kind);
return DateTime.SpecifyKind(parsedDateTime, kind);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public class RefRequestBuilder : BaseRequestBuilder {
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public RefRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/{appManagementPolicy%2Did}/$ref{?%40id*}", pathParameters) {
public RefRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/{appManagementPolicy%2Did}/$ref", pathParameters) {
}
/// <summary>
/// Instantiates a new RefRequestBuilder and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public RefRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/{appManagementPolicy%2Did}/$ref{?%40id*}", rawUrl) {
public RefRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/{appManagementPolicy%2Did}/$ref", rawUrl) {
}
/// <summary>
/// Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
Expand All @@ -35,10 +35,10 @@ public RefRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(r
/// <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
#nullable enable
public async Task DeleteAsync(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) {
public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) {
#nullable restore
#else
public async Task DeleteAsync(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) {
public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) {
#endif
var requestInfo = ToDeleteRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
Expand All @@ -53,10 +53,10 @@ public async Task DeleteAsync(Action<RequestConfiguration<RefRequestBuilderDelet
/// <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
#nullable enable
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>>? requestConfiguration = default) {
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) {
#nullable restore
#else
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>> requestConfiguration = default) {
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) {
#endif
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
Expand All @@ -71,25 +71,10 @@ public RefRequestBuilder WithUrl(string rawUrl) {
return new RefRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
/// </summary>
public class RefRequestBuilderDeleteQueryParameters {
/// <summary>Delete Uri</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("%40id")]
public string? Id { get; set; }
#nullable restore
#else
[QueryParameter("%40id")]
public string Id { get; set; }
#endif
}
/// <summary>
/// Configuration for the request such as headers, query parameters, and middleware options.
/// </summary>
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
public class RefRequestBuilderDeleteRequestConfiguration : RequestConfiguration<RefRequestBuilderDeleteQueryParameters> {
public class RefRequestBuilderDeleteRequestConfiguration : RequestConfiguration<DefaultQueryParameters> {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,34 @@ public class RefRequestBuilder : BaseRequestBuilder {
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public RefRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/$ref{?%24top,%24skip,%24search,%24filter,%24count,%24orderby}", pathParameters) {
public RefRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/$ref{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%40id*}", pathParameters) {
}
/// <summary>
/// Instantiates a new RefRequestBuilder and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public RefRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/$ref{?%24top,%24skip,%24search,%24filter,%24count,%24orderby}", rawUrl) {
public RefRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/applications/{application%2Did}/appManagementPolicies/$ref{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%40id*}", rawUrl) {
}
/// <summary>
/// Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
/// Find more info here <see href="https://learn.microsoft.com/graph/api/appmanagementpolicy-delete-appliesto?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>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task DeleteAsync(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) {
#nullable restore
#else
public async Task DeleteAsync(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) {
#endif
var requestInfo = ToDeleteRequestInformation(requestConfiguration);
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
{"4XX", ODataError.CreateFromDiscriminatorValue},
{"5XX", ODataError.CreateFromDiscriminatorValue},
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// The appManagementPolicy applied to this application.
Expand Down Expand Up @@ -70,6 +90,22 @@ public async Task PostAsync(ReferenceCreate body, Action<RequestConfiguration<De
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
/// </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
#nullable enable
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>>? requestConfiguration = default) {
#nullable restore
#else
public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<RefRequestBuilderDeleteQueryParameters>> requestConfiguration = default) {
#endif
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
return requestInfo;
}
/// <summary>
/// The appManagementPolicy applied to this application.
/// </summary>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand Down Expand Up @@ -112,6 +148,27 @@ public RefRequestBuilder WithUrl(string rawUrl) {
return new RefRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
/// </summary>
public class RefRequestBuilderDeleteQueryParameters {
/// <summary>The delete Uri</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("%40id")]
public string? Id { get; set; }
#nullable restore
#else
[QueryParameter("%40id")]
public string Id { get; set; }
#endif
}
/// <summary>
/// Configuration for the request such as headers, query parameters, and middleware options.
/// </summary>
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
public class RefRequestBuilderDeleteRequestConfiguration : RequestConfiguration<RefRequestBuilderDeleteQueryParameters> {
}
/// <summary>
/// The appManagementPolicy applied to this application.
/// </summary>
public class RefRequestBuilderGetQueryParameters {
Expand Down
Loading

0 comments on commit d817c16

Please sign in to comment.