microsoft / Partner-Center-Java

Partner Center SDK for Java
https://docs.microsoft.com/java/partnercenter/
31 stars 12 forks source link

Add parameter agreement type into get agreement metadata request #75

Closed msize closed 5 years ago

msize commented 5 years ago

Add parameter agreement type into get agreement metadata request

According to the documentation 1 and 2 added optional parameter agreementType into Get agreement metadata and Get confirmation of customer acceptance requests.

Getting a list of all available types of agreements: partnerOperations.getAgreementDetails().get();

Getting a list of specified type of agreements: partnerOperations.getAgreementDetails().byAgreementType(agreementType).get();

Getting a list of all agreements between a partner and customer: partnerOperations.getCustomers().byId(customerId).getAgreements().get()

Getting a list of specified type agreements between a partner and customer: partnerOperations.getCustomers().byId(customerId).getAgreements().byAgreementType(agreementType).get()

msize commented 5 years ago

Hi, @isaiahwilliams

I've seen you commit in dev branch with similar changes and I have some opinion about implementation that:

  1. Using the filter parameter in getting is not common for PC SDK. In PC SDK for filtering usually used bySomething methods.
  2. Using String for filter parameter is not type-safe approach.

Could you look on this pull request, I guess it's closer to the spirit of this library.

ghost commented 5 years ago

Hi @msize,

The reason I have implemented the way I did was to match what has been done in the .NET SDK. Historically changes made to the .NET SDK were simply mirrored for this library. That had several advantages, but it does present some unique challenges. Let me reach out to the other team, to see what they think about this approach instead.