Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.paypal.api.payments;
  
  import java.io.File;
  import java.util.HashMap;
  import java.util.List;
  
 
 public class WebProfile  {

Unique ID of the web experience profile.
 
 	private String id;

Name of the web experience profile. Unique only among the profiles for a given merchant.
 
 	private String name;

Parameters for flow configuration.
 
 	private FlowConfig flowConfig;

Parameters for input fields customization.
 
 	private InputFields inputFields;

Parameters for style and presentation.
 
Returns the last request sent to the Service

Returns:
Last request sent to the server
 
 	public static String getLastRequest() {
 		return PayPalResource.getLastRequest();
 	}

Returns the last response returned by the Service

Returns:
Last response got from the Service
 
 	public static String getLastResponse() {
 		return PayPalResource.getLastResponse();
 	}

Initialize using InputStream(of a Properties file)

Parameters:
is InputStream
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
com.paypal.base.rest.PayPalRESTException
 
 		return PayPalResource.initConfig(is);
 	}

Initialize using a File(Properties file)

Parameters:
file File object of a properties entity
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
com.paypal.base.rest.PayPalRESTException
 
 	public static OAuthTokenCredential initConfig(File filethrows PayPalRESTException {
 		return PayPalResource.initConfig(file);
 	}

Initialize using Properties

Parameters:
properties Properties object
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
 
 	public static OAuthTokenCredential initConfig(Properties properties) {
 		return PayPalResource.initConfig(properties);
 	}
Default Constructor
	public WebProfile() {
	}

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


Setter for id
	public WebProfile setId(String id) {
		this. = id;
		return this;
	}

Getter for id
	public String getId() {
		return this.;
	}


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

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


Setter for flowConfig
	public WebProfile setFlowConfig(FlowConfig flowConfig) {
		this. = flowConfig;
		return this;
	}

Getter for flowConfig
		return this.;
	}


Setter for inputFields
	public WebProfile setInputFields(InputFields inputFields) {
		this. = inputFields;
		return this;
	}

Getter for inputFields
		return this.;
	}


Setter for presentation
	public WebProfile setPresentation(Presentation presentation) {
		this. = presentation;
		return this;
	}

Getter for presentation
		return this.;
	}


Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI.

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

Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
CreateProfileResponse
Throws:
com.paypal.base.rest.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/payment-experience/web-profiles";
		String payLoad = this.toJSON();
		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadCreateProfileResponse.class);
	}


Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation.

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

Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
Throws:
com.paypal.base.rest.PayPalRESTException
	public void update(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());
		if (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payment-experience/web-profiles/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = this.toJSON();
		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
		return;
	}


Partially update an existing web experience profile by passing the ID of the profile to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, path of the profile location to update, and a new value if needed to complete the operation.

Parameters:
accessToken Access Token used for the API call.
patchRequest PatchRequest
Returns:
Throws:
com.paypal.base.rest.PayPalRESTException
	public void partialUpdate(String accessTokenPatchRequest patchRequestthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		partialUpdate(apiContextpatchRequest);
		return;
	}

Partially update an existing web experience profile by passing the ID of the profile to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, path of the profile location to update, and a new value if needed to complete the operation.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
patchRequest PatchRequest
Returns:
Throws:
com.paypal.base.rest.PayPalRESTException
	public void partialUpdate(APIContext apiContextPatchRequest patchRequestthrows 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 (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
		}
		if (patchRequest == null) {
			throw new IllegalArgumentException("patchRequest cannot be null");
		}
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payment-experience/web-profiles/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = patchRequest.toJSON();
		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
		return;
	}


Retrieve the details of a particular web experience profile by passing the ID of the profile to the request URI.

Parameters:
accessToken Access Token used for the API call.
profileId String
Returns:
WebProfile
Throws:
com.paypal.base.rest.PayPalRESTException
	public static WebProfile get(String accessTokenString profileIdthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return get(apiContextprofileId);
	}

Retrieve the details of a particular web experience profile by passing the ID of the profile to the request URI.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
profileId String
Returns:
WebProfile
Throws:
com.paypal.base.rest.PayPalRESTException
	public static WebProfile get(APIContext apiContextString profileIdthrows 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 (profileId == null) {
			throw new IllegalArgumentException("profileId cannot be null");
		}
		Object[] parameters = new Object[] {profileId};
		String pattern = "v1/payment-experience/web-profiles/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadWebProfile.class);
	}


Lists all web experience profiles that exist for a merchant (or subject).

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

Lists all web experience profiles that exist for a merchant (or subject).

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
WebProfileList
Throws:
com.paypal.base.rest.PayPalRESTException
	public static List<WebProfilegetList(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/payment-experience/web-profiles";
		String payLoad = "";
		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadWebProfileList.class);
	}


Delete an existing web experience profile by passing the profile ID to the request URI.

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

Delete an existing web experience profile by passing the profile ID to the request URI.

Parameters:
apiContext com.paypal.base.rest.APIContext used for the API call.
Returns:
Throws:
com.paypal.base.rest.PayPalRESTException
	public void delete(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());
		if (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
		}
			apiContext.setMaskRequestId(true);
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/payment-experience/web-profiles/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
		return;
	}

Returns a JSON string corresponding to object state

Returns:
JSON representation
	public String toJSON() {
		return JSONFormatter.toJSON(this);
	}
	public String toString() {
		return toJSON();
	}
New to GrepCode? Check out our FAQ X