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

org.springframework.social.partnercenter.api.uri.UriProvider 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.uri;

import org.springframework.web.util.UriComponentsBuilder;

public class UriProvider {
	public static String OAUTH_HOST = "https://login.windows.net";
	public static String GRAPH_URL = "https://graph.windows.net";
	public static String PARTNER_CENTER_URL = "https://api.partnercenter.microsoft.com";

	public static String buildPartnerCenterOAuth2Uri(String tenantId){
		return UriComponentsBuilder.fromUriString(OAUTH_HOST)
				.pathSegment(tenantId)
				.pathSegment("oauth2")
				.pathSegment("token")
				.build()
				.toString();
	}

	public static String buildPartnerCenterTokenUri(){
		return UriComponentsBuilder.fromUriString(PARTNER_CENTER_URL)
				.pathSegment("generatetoken")
				.build().toString();
	}

	public static UriComponentsBuilder partnerCenterBuilder(){
		return UriComponentsBuilder.fromUriString(PARTNER_CENTER_URL);
	}

	public static UriComponentsBuilder partnerCenterInvoiceUri(){
		return partnerCenterBuilder().pathSegment("v1", "invoices");
	}

	public static UriComponentsBuilder partnerCenterPricingUri(){
		return partnerCenterBuilder().pathSegment("v1", "ratecards", "azure");
	}

	public static UriComponentsBuilder partnerCenterOfferUri(){
		return partnerCenterBuilder().pathSegment("v1", "offers");
	}

	public static UriComponentsBuilder partnerCenterCustomerUri(){
		return partnerCenterBuilder().pathSegment("v1", "customers");
	}

	public static UriComponentsBuilder partnerCenterProfileUri(){
		return partnerCenterBuilder().pathSegment("v1", "profiles");
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy