-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Client bug]: ...Channels.GetAllMessages cannot implement billing (model=B) #1979
Closed
Labels
Comments
ghost
added
the
Needs: Triage
label
Jun 20, 2023
I have managed a work around with: // get the requestInfo from the builder
var req = _graphClient.Teams[teamId].Channels.GetAllMessages.ToGetRequestInformation();
// manually set the URI with the billing parameter as a work around.
req.URI = new Uri($"https://graph.microsoft.com/v1.0/teams/{teamId}/channels/getAllMessages()?model=B&%24top=200");
// copy the error mapping from the builder
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
{"4XX", ODataError.CreateFromDiscriminatorValue},
{"5XX", ODataError.CreateFromDiscriminatorValue},
};
var res = await _graphClient.RequestAdapter.SendAsync(req, GetAllMessagesResponse.CreateFromDiscriminatorValue, errorMapping); This could potentially be a simple fix: namespace Microsoft.Graph.Teams.GetAllMessages {
/// <summary>
/// Provides operations to call the getAllMessages method.
/// </summary>
public class GetAllMessagesRequestBuilder : BaseRequestBuilder {
/// <summary>
/// Instantiates a new GetAllMessagesRequestBuilder and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public GetAllMessagesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teams/getAllMessages(){?model,%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}", pathParameters) {
}
/// <summary>
/// Instantiates a new GetAllMessagesRequestBuilder 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 GetAllMessagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teams/getAllMessages(){?model,%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}", rawUrl) {
}
//...
/// <summary>
/// Invoke function getAllMessages
/// </summary>
public class GetAllMessagesRequestBuilderGetQueryParameters {
/// <summary>Include billing model</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("model")]
public string? Model { get; set; } // "A" | "B"
#nullable restore
#else
[QueryParameter("model")]
public string Model { get; set; } // "A" | "B"
#endif
/// <summary>Include count of items</summary>
[QueryParameter("%24count")]
public bool? Count { get; set; }
//...
}
} |
Depends on microsoftgraph/msgraph-metadata#314 |
This was referenced Jun 26, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I can use the correct billing method with a query param in an http request, but there is no way to do this in the SDK:
https://graph.microsoft.com/v1.0/teams/{{team-id}}/channels/getAllMessages?model=B
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
Client version
5.8.0
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: