All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.social.partnercenter.api.agreement.AgreementTemplate Maven / Gradle / Ivy

Go to download

A provider extension for Spring Social to enable connectivity with Microsoft and an API binding for Microsoft's Partner Center API.

There is a newer version: 10.11.0
Show newest version
package org.springframework.social.partnercenter.api.agreement;

import static org.springframework.social.partnercenter.api.validation.Assertion.notNull;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
import org.springframework.social.partnercenter.api.PagingResourceTemplate;
import org.springframework.social.partnercenter.api.PartnerCenterResponse;
import org.springframework.social.partnercenter.http.client.RestResource;

public class AgreementTemplate extends PagingResourceTemplate implements AgreementOperations {
	private RestResource restResource;

	public AgreementTemplate(RestResource restResource, boolean isAuthorized) {
		super(restResource, isAuthorized, new ParameterizedTypeReference>() {});
		this.restResource = restResource;
	}

	@Override
	public ResponseEntity confirmCustomerAcceptance(String customerTenantId, Agreement agreement) {
		notNull(customerTenantId, "customerTenantId");
		notNull(agreement, "agreement");
		return restResource.request()
				.pathSegment("customers", customerTenantId, "agreements")
				.post(agreement, Agreement.class);
	}

	@Override
	public ResponseEntity> getConfirmations(String customerTenantId) {
		notNull(customerTenantId, "customerTenantId");
		return restResource.request()
				.pathSegment("customers", customerTenantId, "agreements")
				.get(new ParameterizedTypeReference>() {});
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy