public class

CoupaModule

extends Object
java.lang.Object
   ↳ org.mule.modules.coupa.CoupaModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Coupa is a provider of cloud spend management (CSM) solutions that help companies control their indirect spending and generate savings that go direct to the bottom line. This Mule Module is cable of creating, updating and finding coupa resources both master resources and transaction resources

Summary

Fields
private String apiKey The token of your company's account in Coupa.
private String baseUrl The base URL of your company's account in Coupa.
private Client coupaClient
private final MapObjectMapper mom
Public Constructors
CoupaModule()
Public Methods
Iterable<Resource> find(ResourceType type, Map<String, String> conditions, boolean exactMatch, int offset, Integer limit)
Searches for resources
Iterable<Resource> findByExample(ResourceType type, Map<String, Object> prototype, boolean exactMatch)
Searches for resources using an example
Resource findById(ResourceType type, long id)
Searches for an specific resource given its type and id
void init()
Initializes the Coupa client
Resource save(ResourceType type, Map<String, Object> resource)
Creates or updates and object.
void setApiKey(String apiKey)
void setBaseUrl(String baseUrl)
void setCoupaClient(Client coupaClient)
Protected Methods
Resource unmap(ResourceType type, Map<String, Object> resource)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String apiKey

The token of your company's account in Coupa. You can get if from the administrative coupa UI, in the API Keys section

private String baseUrl

The base URL of your company's account in Coupa. Its looks like https://[company].[coupahost].com/api

private Client coupaClient

private final MapObjectMapper mom

Public Constructors

public CoupaModule ()

Public Methods

public Iterable<Resource> find (ResourceType type, Map<String, String> conditions, boolean exactMatch, int offset, Integer limit)

Searches for resources

Parameters
type The type of resource to search
conditions TODO
exactMatch TODO
offset TODO
limit TODO
Returns
  • an iterable of resources

public Iterable<Resource> findByExample (ResourceType type, Map<String, Object> prototype, boolean exactMatch)

Searches for resources using an example

Parameters
type The type of object to search
prototype The example. Fields set will be used as search conditions
exactMatch TODO
Returns
  • an iterable of resources

public Resource findById (ResourceType type, long id)

Searches for an specific resource given its type and id

Parameters
type The type of resource to search
id The id of the resources
Returns
  • the resource for the given id
Throws
RESTException if there is not resource for the given id and type

public void init ()

Initializes the Coupa client

public Resource save (ResourceType type, Map<String, Object> resource)

Creates or updates and object. If the resource's id is not null, the connector creates it. Otherwise, it updates the present fields, leaving the rest of fields unchanged.

Parameters
type The type of the resource to update
resource The resource
Returns
  • the updated or created object
Throws
RESTException if the object can not be created

public void setApiKey (String apiKey)

Parameters
apiKey

public void setBaseUrl (String baseUrl)

Parameters
baseUrl

public void setCoupaClient (Client coupaClient)

Parameters
coupaClient

Protected Methods

protected Resource unmap (ResourceType type, Map<String, Object> resource)

Parameters
type
resource