com.mastercard.api.mcon.Benefits Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mc-on Show documentation
Show all versions of mc-on Show documentation
Java Core SDK for use with SDKs available on MasterCard Developer Zone (https://developer.mastercard.com)
/*
* Copyright 2016 MasterCard International.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of the MasterCard International Incorporated nor the names of its
* contributors may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
package com.mastercard.api.mcon;
import com.mastercard.api.core.exception.*;
import com.mastercard.api.core.model.*;
import com.mastercard.api.core.security.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Benefits extends BaseObject {
private static Map operationConfigs;
static {
operationConfigs = new HashMap();
operationConfigs.put("681cde54-8d22-45e8-9ee6-c678bf36a2f0", new OperationConfig("/loyalty/v1/benefits/assigned", Action.query, Arrays.asList("ica","userId","panLastFourDigits","channel","preferredLanguage"), Arrays.asList("x-client-correlation-id")));
operationConfigs.put("1bca1d04-8b75-4d66-96f2-5910cb08c13f", new OperationConfig("/loyalty/v1/benefits/{benefitId}/detail", Action.query, Arrays.asList("ica","channel","preferredLanguage"), Arrays.asList("x-client-correlation-id")));
operationConfigs.put("6deeeea1-4547-404b-af84-73378a01248e", new OperationConfig("/loyalty/v1/benefits", Action.query, Arrays.asList("ica","cardProductType","channel","preferredLanguage"), Arrays.asList("x-client-correlation-id")));
operationConfigs.put("e974b691-da2e-4cc0-82e8-ac9a4750ea8e", new OperationConfig("/loyalty/v1/benefits", Action.create, Arrays.asList(""), Arrays.asList("x-client-correlation-id")));
operationConfigs.put("7f0d7e8d-fd99-40c4-b0e3-81e436074689", new OperationConfig("/loyalty/v1/benefits/programterms", Action.query, Arrays.asList("ica","preferredLanguage"), Arrays.asList("x-client-correlation-id")));
operationConfigs.put("0c591bb5-dfa1-4f42-b4e6-27977a0bf0f2", new OperationConfig("/loyalty/v1/users/{userId}/benefits", Action.query, Arrays.asList("panLastFourDigits"), Arrays.asList("x-client-correlation-id")));
}
public Benefits() {
}
public Benefits(BaseObject o) {
putAll(o);
}
public Benefits(RequestMap requestMap) {
putAll(requestMap);
}
@Override protected final OperationConfig getOperationConfig(String operationUUID) throws IllegalArgumentException{
OperationConfig operationConfig = operationConfigs.get(operationUUID);
if(operationConfig == null) {
throw new IllegalArgumentException("Invalid operationUUID supplied: " + operationUUID);
}
return operationConfig;
}
@Override protected OperationMetadata getOperationMetadata() throws IllegalArgumentException {
return new OperationMetadata(ResourceConfig.getInstance().getVersion(), ResourceConfig.getInstance().getHost(), ResourceConfig.getInstance().getContext(), ResourceConfig.getInstance().getJsonNative(), ResourceConfig.getInstance().getContentTypeOverride());
}
/**
* Query / Retrieve a Benefits
object
*
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getAssignedBenefits(RequestMap query)
throws ApiException {
return getAssignedBenefits(null, query);
}
/**
* Query / Retrieve a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getAssignedBenefits(Authentication auth, RequestMap query)
throws ApiException {
Benefits val = new Benefits();
if (query != null) val.putAll(query);
return new Benefits(BaseObject.executeOperation(auth, "681cde54-8d22-45e8-9ee6-c678bf36a2f0", val));
}
/**
* Query / Retrieve a Benefits
object
*
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getBenefitDetail(RequestMap query)
throws ApiException {
return getBenefitDetail(null, query);
}
/**
* Query / Retrieve a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getBenefitDetail(Authentication auth, RequestMap query)
throws ApiException {
Benefits val = new Benefits();
if (query != null) val.putAll(query);
return new Benefits(BaseObject.executeOperation(auth, "1bca1d04-8b75-4d66-96f2-5910cb08c13f", val));
}
/**
* Query / Retrieve a Benefits
object
*
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getBenefits(RequestMap query)
throws ApiException {
return getBenefits(null, query);
}
/**
* Query / Retrieve a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getBenefits(Authentication auth, RequestMap query)
throws ApiException {
Benefits val = new Benefits();
if (query != null) val.putAll(query);
return new Benefits(BaseObject.executeOperation(auth, "6deeeea1-4547-404b-af84-73378a01248e", val));
}
/**
* Creates a Benefits
object
*
* @param map a map of parameters to create a Benefits
object
*
* @return a Benefits object.
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits selectBenefits(RequestMap map)
throws ApiException {
return selectBenefits(null, map);
}
/**
* Creates a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param map a map of parameters to create a Benefits
object
*
* @return a Benefits object.
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits selectBenefits(Authentication auth, RequestMap map)
throws ApiException {
return new Benefits(BaseObject.executeOperation(auth, "e974b691-da2e-4cc0-82e8-ac9a4750ea8e", new Benefits(map)));
}
/**
* Query / Retrieve a Benefits
object
*
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getProgramTerms(RequestMap query)
throws ApiException {
return getProgramTerms(null, query);
}
/**
* Query / Retrieve a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits getProgramTerms(Authentication auth, RequestMap query)
throws ApiException {
Benefits val = new Benefits();
if (query != null) val.putAll(query);
return new Benefits(BaseObject.executeOperation(auth, "7f0d7e8d-fd99-40c4-b0e3-81e436074689", val));
}
/**
* Query / Retrieve a Benefits
object
*
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits userBenefitsRegistrationStatus(RequestMap query)
throws ApiException {
return userBenefitsRegistrationStatus(null, query);
}
/**
* Query / Retrieve a Benefits
object
*
* @param auth Authentication object overriding ApiConfig.setAuthentication(authentication)
* @param query a map of query parameters
*
* @return a Benefits object
*
* @throws ApiException - which encapsulates the http status code and the error return by the server
*/
public static Benefits userBenefitsRegistrationStatus(Authentication auth, RequestMap query)
throws ApiException {
Benefits val = new Benefits();
if (query != null) val.putAll(query);
return new Benefits(BaseObject.executeOperation(auth, "0c591bb5-dfa1-4f42-b4e6-27977a0bf0f2", val));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy