Skip to content

SDK needs to support model filters for AllRetainedMessages #2811

@adrianmander

Description

@adrianmander

Is your feature request related to a problem? Please describe the problem.

I want to make requests to the AllRetainedMessages endpoint. For paid subscriptions this requires the Model parameter to be set.

Doing this doesn't work yet.

    RequestInformation historicalMessagesRequest = _graphServiceClient
        .Users[userGuid]
        .Chats
        .GetAllRetainedMessages
        .ToGetRequestInformation(configuration =>
        {
            // configuration.QueryParameters.Model = "ModelA" ; todo this doesn't work yet
        });

I have a work around that's low level and gross.

historicalMessagesRequest.UrlTemplate =
    "{+baseurl}/users/{user%2Did}/chats/getAllRetainedMessages()" +
     "{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top,model*}";

 historicalMessagesRequest.QueryParameters["model"] = "ModelA";

You have to both manually add your licensing model to the query parameters, and adjust the url template so that this model goes to the actual request url made by the SDK. This is hokey and janky.

Describe the solution you'd like.

Can we just have this work, for parity with AllMessages?

    RequestInformation historicalMessagesRequest = _graphServiceClient
        .Users[userGuid]
        .Chats
        .GetAllRetainedMessages
        .ToGetRequestInformation(configuration =>
        {
            configuration.QueryParameters.Model = "ModelA";  // Just make this compile and work
        });

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependency:metadataAwaiting fix from core dependency project moduletype:featureNew experience request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions