Skip to content
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

We should align with other languages and make initialization easier #180

Closed
isvargasmsft opened this issue Apr 25, 2023 · 2 comments · Fixed by #219
Closed

We should align with other languages and make initialization easier #180

isvargasmsft opened this issue Apr 25, 2023 · 2 comments · Fixed by #219
Assignees
Labels
enhancement New feature or request

Comments

@isvargasmsft
Copy link
Member

As discussed, we'd like to abstract these 3 lines of code:

auth_provider = AzureIdentityAuthenticationProvider(credential, scopes=scopes)

# Initialize a request adapter. Handles the HTTP concerns
request_adapter = GraphRequestAdapter(auth_provider)

# Get a service client
client = GraphServiceClient(request_adapter)

And only request from the developer to specify the context, the scope and its required values.

@isvargasmsft
Copy link
Member Author

CC: @samwelkanda @shemogumbe @baywet

@baywet
Copy link
Member

baywet commented Apr 25, 2023

if possible an overload constructor defined in a derived class is probably the best option here. The generated client would become the BaseGraphClient and this manually crafted class that derives from it would become GraphServiceClient, and accept credential and scopes directly.
That overload constructor should not mask the default one with the request adapter as people in need of more advanced configuration should still be able to pass a request adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants