Logo

Docs

  • HOME

Class: Customer

Customer

new Customer()

Create a new instance of Customer
Properties:
Name Type Description
status String status of the customer loaded
title String customer's title
country String customer's country
referer String customer's referer
published Date published date
renewalDate Date date of renewal
userCount Number number of users
userCredit Number number of credit users
subscriptions Array list of subscriptions asociated to this customer
traffics Array list of traffics asociated to this customer
i18n Object internationalization obect containing different libraries
users Array list of users asociated to this customer
domains Array list of domains asociated to this customer
overdue Object overdue users status and quantity
inOrder Object inOrder users status and quantity
Source:
  • Customer/Customer.js, line 59
See:
  • CustomerList
  • Resource
Examples
Load customer

	var c = new Customer();
	c.load({
		onSuccess:function(){
			alert('"'+c.title + '" loaded!');
		}
	});
	
	
Load customer User information
	var c = new Customer();
	c.load({
		onSuccess:function(){
			alert(c.inOrder.ACTIVE);
		}
	});

Methods

generate_xml()

Generates a save/update xml to be posted to the server
Source:
  • Customer/Customer.js, line 170

generateUrl()

Overrides Resource's generateUrl method to return the request url
Source:
  • Customer/Customer.js, line 93
See:
  • Resource#generateUrl

loadDomains(options)

Load a list the list of Domains.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
  • Customer/Customer.js, line 338
See:
  • Resource#load
Example
Load domains
        function loadDomains(p_customer){//customer object
			p_customer.loadDomains({
				onSuccess:function(){
					alert("there are " +p_customer.domains.length+" domains");
				}
			});
		};

loadPreset()

Overrides Resource's loadPreset method.
Source:
  • Customer/Customer.js, line 87
See:
  • Resource#loadPreset

loadSet(rObject)

Overrides Resource's loadSet method to set local variables after request.
Parameters:
Name Type Description
rObject json JSON representation of the loaded data.
Source:
  • Customer/Customer.js, line 103
See:
  • Resource#loadSet

loadSubscriptions(options)

Load a list the list of subscriptions.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
  • Customer/Customer.js, line 209
See:
  • Resource#load
Example
Load subscriptions
        function loadSubscriptions(p_customer){//customer object
			p_customer.loadSubscriptions({
				onSuccess:function(){
					alert("there are " +p_customer.subscriptions.length+" subscriptions");
				}
			});
		};

loadTraffics(options)

Load a list the list of traffics.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
  • Customer/Customer.js, line 252
See:
  • Resource#load
Example
Load traffics
        function loadTraffics(p_customer){//customer object
			p_customer.loadTraffics({
				onSuccess:function(){
					alert("there are " +p_customer.traffics.length+" traffics");
				}
			});
		};

loadUsers(options)

Load a list the list of Users.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
  • Customer/Customer.js, line 295
See:
  • Resource#load
Example
Load users
        function loadUsers(p_customer){//customer object
			p_customer.loadUsers({
				onSuccess:function(){
					alert("there are " +p_customer.users.length+" users");
				}
			});
		};

update(options)

Overrides Resource's loadPreset method.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
  • Customer/Customer.js, line 156
See:
  • Resource#update
Example
update a Customer
		function updateCustomer(cust){//loaded customer object
			cust.title = 'new_title';//data change example
			cust.update({
				onSuccess:function(){
					alert("Customer Updated!");
				}
			});
		}

Index

Classes

  • AccessLog
  • AllLaneUserList
  • AppInstanceReport
  • Context
  • Customer
  • CustomerDomainList
  • CustomerList
  • CustomerSubscriptionList
  • CustomerTrafficList
  • CustomList
  • CustomListList
  • Domain
  • Host
  • HostList
  • HostMode
  • I18n
  • I18nDico
  • Lane
  • LaneList
  • LanePoolList
  • LogLog
  • Metadata
  • Oauth
  • OauthList
  • Pool
  • PoolList
  • Preferences
  • Process
  • ProcessList
  • Project
  • ProjectAppliQuery
  • ProjectChildList
  • ProjectLaneList
  • ProjectList
  • ProjectProcess
  • ProjectProcessList
  • ProjectProcessQuery
  • ProjectVersion
  • ProjectVersionList
  • Report
  • RequestLog
  • Resource
  • SavedQuery
  • Subscription
  • Token
  • Traffic
  • Usage
  • User
  • UserAccessList
  • UserDelegation
  • UserDelegationList
  • UserLaneList
  • UserList
  • UserRepresentationList
  • UserSupportAuth
  • UserSupportAuthList
  • WebInterface
  • WebInterfaceList

Global

  • context

© Akorbi Digital RMP. All Rights Reserved - Legal terms - Contact