-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add Batch to graph client #915
Conversation
Thank you for making the changes! |
We'll also need a similar PR in the beta lib too https://github.com/microsoftgraph/msgraph-beta-sdk-python |
Mered before seeing this, will do another branch to trigger the release |
does the batch thing only work for the |
@chandra447 it should work for any operation to the exception of the ones that need to upload or download files |
@baywet this is how i am doing this, but it throws creds = ClientSecretCredential(
tenant_id=settings.tenant_id, client_id=settings.app_id, client_secret=settings.client_secret
)
client = GraphServiceClient(credentials=credentials, scopes=['https://graph.microsoft.com/.default'])
request_body = ListItem(
fields = FieldValueSet(
additional_data = {
"title" : "Widget",
"color" : "Purple",
"weight" : 32,
}
),
)
request_info1: RequestInformation = client.sites.by_site_id(settings.site_id)
.lists.by_list_id(settings.list_id)
.items.to_post_request_information(body=request_body)
batch_request_content: BatchRequestContent = BatchRequestContent()
# using the setter requests setter
batch_request_content.requests = [
BatchRequestItem(
request_information=request_info1,
),
]
batch_response_content: BatchResponseContent = await client.batch.post(
batch_request_content=batch_request_content
)
for response in batch_response_content.responses.values():
print(response.status)
print(response.body)
print(response.headers) |
Can you please open a new issue? |
i have created a new issue outlining this |
Leads to this usage: