Skip to content

Conversation

@andrueastman
Copy link
Contributor

This PR closes #45

Changes proposed in this pull request

  1. Adds overload to add steps using HttpRequestMessage to support a scenario like
HttpRequestMessage httpRequestMessage1 = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me/");
HttpRequestMessage httpRequestMessage2 = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me/calendars");

// Add batch request steps to BatchRequestContent.
BatchRequestContent batchRequestContent = new BatchRequestContent();
batchRequestContent.AddBatchRequestStep(httpRequestMessage1);
batchRequestContent.AddBatchRequestStep(httpRequestMessage2);

// Send batch request with BatchRequestContent. 
HttpResponseMessage response = await httpClient.PostAsync("https://graph.microsoft.com/v1.0/$batch", batchRequestContent);
  1. Adds overload to add steps using IBaseRequest to support a scenario like
IUserRequest request1 = graphServiceClient.Me.Request();
IUserCalendarsCollectionRequest request2 = graphServiceClient.Me.Calendars.Request();

// Add batch request steps to BatchRequestContent.
BatchRequestContent batchRequestContent = new BatchRequestContent();
batchRequestContent.AddBatchRequestStep(request1);
batchRequestContent.AddBatchRequestStep(request2);

// Send batch request with BatchRequestContent. 
HttpResponseMessage response = await httpClient.PostAsync("https://graph.microsoft.com/v1.0/$batch", batchRequestContent);
  1. Adds tests to validate the behavior and to ensure BatchRequestSteps do not exceed max value set for the batch endpoint

- Adds overload to add steps using HttpRequestMessage
- Adds overload to add steps using IBaseRequest
- Adds tests to validate
- Adds checks to ensure steps do not exceed max value set for graph
@andrueastman andrueastman self-assigned this Oct 11, 2019
@andrueastman andrueastman marked this pull request as ready for review October 11, 2019 13:53
@darrelmiller darrelmiller added this to the 1.19.0 milestone Oct 11, 2019
@MIchaelMainer MIchaelMainer requested a review from peombwa October 15, 2019 20:51
@andrueastman
Copy link
Contributor Author

@MIchaelMainer @peombwa @darrelmiller This should be ready to review.
#49 will track updating the already existing AddBatchRequestStep(BatchRequestStep batchRequestStep) overload on the next breaking change.

@andrueastman andrueastman merged commit 3e8f7d7 into dev Oct 18, 2019
@andrueastman andrueastman deleted the andrueastman/batch-request-step-enhancements branch October 23, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BatchRequestStep enhancements

4 participants