microsoft-graph-devx-api icon indicating copy to clipboard operation
microsoft-graph-devx-api copied to clipboard

update request configuration class - DO NOT MERGE

Open shemogumbe opened this issue 9 months ago • 1 comments

Overview

Closes https://github.com/microsoftgraph/msgraph-sdk-python/issues/680 From

query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
            search=[
                f'("displayName:{user_name}" OR "mail:{user_name}" OR "userPrincipalName:{user_name}" OR "givenName:{user_name}" OR "surName:{user_name}" OR "otherMails:{user_name}")'
            ], )
        request_configuration = (
            UsersRequestBuilder.UsersRequestBuilderGetRequestConfiguration(
                query_parameters=query_params, ))

        request_configuration.headers.add("ConsistencyLevel", "eventual")

        response = await user_client.users.get(
            request_configuration=request_configuration)

To

from kiota_abstractions.base_request_configuration import RequestConfiguration

query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
            search=[
                f'("displayName:{user_name}" OR "mail:{user_name}" OR "userPrincipalName:{user_name}" OR "givenName:{user_name}" OR "surName:{user_name}" OR "otherMails:{user_name}")'
        ], )
    request_configuration = RequestConfiguration(
        query_parameters=query_params, )

    request_configuration.headers.add("ConsistencyLevel", "eventual")

    response = await user_client.users.get(
        request_configuration=request_configuration)
Microsoft Reviewers: Open in CodeFlow

shemogumbe avatar Apr 29 '24 17:04 shemogumbe