Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.paypal.api.payments;
  
  import java.util.HashMap;
  
 
 public class EventType  extends PayPalResource {

Unique event-type name.
 
 	private String name;

Human readable description of the event-type
 
 	private String description;

Default Constructor
 
 	public EventType() {
 	}

Parameterized Constructor
 
 	public EventType(String name) {
 		this. = name;
 	}


Setter for name
 
 	public EventType setName(String name) {
 		this. = name;
 		return this;
 	}

Getter for name
 
 	public String getName() {
 		return this.;
 	}


Setter for description
 
 	public EventType setDescription(String description) {
 		this. = description;
 		return this;
 	}

Getter for description
 
 	public String getDescription() {
 		return this.;
 	}


Retrieves the list of events-types subscribed by the given Webhook.

Parameters:
accessToken Access Token used for the API call.
webhookId String
Returns:
EventTypeList
Throws:
com.paypal.base.rest.PayPalRESTException
 
 	public static EventTypeList subscribedEventTypes(String accessTokenString webhookIdthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		return subscribedEventTypes(apiContextwebhookId);
 	}

Retrieves the list of events-types subscribed by the given Webhook.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
webhookId String
Returns:
EventTypeList
Throws:
com.paypal.base.rest.PayPalRESTException
 
 	public static EventTypeList subscribedEventTypes(APIContext apiContextString webhookIdthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		}
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		}
		apiContext.setSdkVersion(new SDKVersionImpl());
		if (webhookId == null) {
			throw new IllegalArgumentException("webhookId cannot be null");
		}
		Object[] parameters = new Object[] {webhookId};
		String pattern = "v1/notifications/webhooks/{0}/event-types";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return configureAndExecute(apiContext.resourcePathpayLoadEventTypeList.class);
	}


Retrieves the master list of available Webhooks events-types resources for any webhook to subscribe to.

Parameters:
accessToken Access Token used for the API call.
Returns:
EventTypeList
Throws:
com.paypal.base.rest.PayPalRESTException
	public static EventTypeList availableEventTypes(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return availableEventTypes(apiContext);
	}

Retrieves the master list of available Webhooks events-types resources for any webhook to subscribe to.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
EventTypeList
Throws:
com.paypal.base.rest.PayPalRESTException
	public static EventTypeList availableEventTypes(APIContext apiContextthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		}
		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		}
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		}
		apiContext.setSdkVersion(new SDKVersionImpl());
		String resourcePath = "v1/notifications/webhooks-event-types";
		String payLoad = "";
		return configureAndExecute(apiContext.resourcePathpayLoadEventTypeList.class);
	}
New to GrepCode? Check out our FAQ X