Skip to content

Commit

Permalink
Update to 18.5
Browse files Browse the repository at this point in the history
  • Loading branch information
han8909227 committed May 29, 2018
1 parent 15c21d1 commit 202a4d2
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ class TransactionAddressType
}


/**
*
*/
class AdvancedRuleScriptType
{
const C_REQUESTRULE = "RequestRule";
const C_RESPONSERULE = "ResponseRule";

}


/**
*
*/
class AdvancedRuleCrashBehavior
{
const C_FAILONERROR = "FailOnError";
const C_PROCEEDWITHORIGINAL = "ProceedWithOriginal";

}


/**
* Casing to use for validation result
*/
Expand Down Expand Up @@ -1104,28 +1126,6 @@ class JurisdictionType
}


/**
*
*/
class AdvancedRuleCrashBehavior
{
const C_FAILONERROR = "FailOnError";
const C_PROCEEDWITHORIGINAL = "ProceedWithOriginal";

}


/**
*
*/
class AdvancedRuleScriptType
{
const C_REQUESTRULE = "RequestRule";
const C_RESPONSERULE = "ResponseRule";

}


/**
* A list of possible AvaFile Form Types.
*/
Expand Down
244 changes: 244 additions & 0 deletions src/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,250 @@ public function resolveAddressPost($model)
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Approve an advanced rule script to run.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return AdvancedRuleScriptModel
*/
public function approveAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/approve";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Create an advanced rule.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that will own the Advanced Rule.
* @param string $scriptType The script transform type, Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @param string $crashBehavior The behavior the script should take if it crashes: Fail or Proceed. (See AdvancedRuleCrashBehavior::* for a list of allowable values)
* @param object $file The JavaScript file containing the advanced rule.
* @return string
*/
public function createAdvancedRuleScript($accountId, $scriptType, $crashBehavior, $file)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}";
$guzzleParams = [
'query' => ['crashBehavior' => $crashBehavior],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Create a lookup table for an advanced rule
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $csvTableName The name to assign the CSV lookup table.
* @param object $file A CSV file containing lookup data for an advanced rule.
* @return string
*/
public function createAdvancedRuleTable($accountId, $csvTableName, $file)
{
$path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Delete an account's active advanced rule
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return ErrorDetail[]
*/
public function deleteAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'DELETE', $guzzleParams);
}

/**
* Delete a lookup table for an advanced rule.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $csvTableName The name of the CSV lookup table to delete.
* @return ErrorDetail[]
*/
public function deleteAdvancedRuleTable($accountId, $csvTableName)
{
$path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'DELETE', $guzzleParams);
}

/**
* Disable an advanced rule so that it cannot be run.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration. ///
*
*
* @param int $accountId
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return AdvancedRuleScriptModel
*/
public function disableAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/disable";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Enable an approved advanced rule so that it can be run.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return AdvancedRuleScriptModel
*/
public function enableAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/enable";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Get an account's advanced rule script.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return AdvancedRuleScriptModel
*/
public function getAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'GET', $guzzleParams);
}

/**
* Get an advanced rule lookup table for an account
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $csvTableName The name of the CSV lookup table to get.
* @return AdvancedRuleTableModel
*/
public function getAdvancedRuleTable($accountId, $csvTableName)
{
$path = "/api/v2/accounts/{$accountId}/advancedruletables/{$csvTableName}";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'GET', $guzzleParams);
}

/**
* Get all advanced rule lookup tables for an account
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @return AdvancedRuleTableModel
*/
public function getAdvancedRuleTables($accountId)
{
$path = "/api/v2/accounts/{$accountId}/advancedruletables";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'GET', $guzzleParams);
}

/**
* Unapprove an advanced rule script so that it cannot be run.
*
* This API is available by invite only and implementation support is required.
* Please contact your Customer Account Manager if you are interested in using
* Advanced Rules in your AvaTax integration.
*
*
* @param int $accountId The ID of the account that owns the Advanced Rule.
* @param string $scriptType The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
* @return AdvancedRuleScriptModel
*/
public function unapproveAdvancedRuleScript($accountId, $scriptType)
{
$path = "/api/v2/accounts/{$accountId}/advancedrulescripts/{$scriptType}/unapprove";
$guzzleParams = [
'query' => [],
'body' => null
];
return $this->restCall($path, 'POST', $guzzleParams);
}

/**
* Create a new AvaFileForm
*
Expand Down

0 comments on commit 202a4d2

Please sign in to comment.