in src/main/java/com/microsoft/store/partnercenter/serviceincidents/ServiceIncidentCollectionOperations.java [64:103]
public ResourceCollection<ServiceIncidents> get(IQuery serviceIncidentsQuery)
{
if (serviceIncidentsQuery == null)
{
throw new IllegalArgumentException("serviceIncidentsQuery can't be null");
}
Collection<KeyValuePair<String, String>> parameters = new ArrayList<KeyValuePair<String, String>>();
if (serviceIncidentsQuery.getFilter() != null)
{
// add the filter to the request if specified
ObjectMapper mapper = new ObjectMapper();
try
{
parameters.add
(
new KeyValuePair<String, String>(
PartnerService.getInstance().getConfiguration().getApis().get("SearchPartnerServiceRequests").getParameters().get("Filter"),
URLEncoder.encode(mapper.writeValueAsString(serviceIncidentsQuery.getFilter()),
"UTF-8"))
);
}
catch (UnsupportedEncodingException e)
{
throw new PartnerException("", null, PartnerErrorCategory.REQUEST_PARSING, e);
}
catch (JsonProcessingException e)
{
throw new PartnerException("", null, PartnerErrorCategory.REQUEST_PARSING, e);
}
}
return this.getPartner().getServiceClient().get(
this.getPartner(),
new TypeReference<ResourceCollection<ServiceIncidents>>(){},
PartnerService.getInstance().getConfiguration().getApis().get("GetServiceIncidents").getPath(),
parameters);
}