Documentation

EasyPostClient extends BaseService
in package

Client used to send requests to the EasyPost API.

Table of Contents

$address  : AddressService
$batch  : BatchService
$betaReferralCustomer  : BetaReferralCustomer
$billing  : BillingService
$carrierAccount  : CarrierAccountService
$customsInfo  : CustomsInfoService
$customsItem  : CustomsItemService
$endShipper  : EndShipperService
$event  : EventService
$insurance  : InsuranceService
$order  : OrderService
$parcel  : ParcelService
$pickup  : PickupService
$rate  : RateService
$referralCustomer  : ReferralCustomerService
$refund  : RefundService
$report  : ReportService
$scanForm  : ScanFormService
$shipment  : ShipmentService
$tracker  : TrackerService
$user  : UserService
$webhook  : WebhookService
$client  : mixed
$apiBase  : mixed
$apiKey  : mixed
$mockingUtility  : mixed
$timeout  : mixed
__construct()  : mixed
Constructor for an EasyPostClient.
__get()  : BaseService
Get a Service when calling a property of an EasyPostClient.
getApiBase()  : string
Get the API Base URL of an EasyPostClient.
getApiKey()  : string
Get the API key of an EasyPostClient.
getMockingUtility()  : object
Get the mock requests of an EasyPostClient.
getTimeout()  : float
Get the timeout of an EasyPostClient.
mock()  : bool
Get whether this client is configured to mock requests
allResources()  : mixed
Internal retrieve all method.
className()  : string
The class name of an object.
classUrl()  : string
The class URL of an object.
createResource()  : mixed
Internal create method.
deleteResource()  : void
Internal delete method.
instanceUrl()  : string
The instance URL of an object.
retrieveResource()  : mixed
Internal retrieve method.
serviceModelClassName()  : string
Gets the class name of a Service's model.
updateResource()  : mixed
Internal update method.
validate()  : mixed
Validate library usage.

Properties

$betaReferralCustomer

public BetaReferralCustomer $betaReferralCustomer

Methods

__construct()

Constructor for an EasyPostClient.

public __construct(string $apiKey[, float $timeout = Constants::TIMEOUT ][, string $apiBase = Constants::API_BASE ][, object $mockingUtility = null ]) : mixed
Parameters
$apiKey : string
$timeout : float = Constants::TIMEOUT
$apiBase : string = Constants::API_BASE
$mockingUtility : object = null
Return values
mixed

getApiBase()

Get the API Base URL of an EasyPostClient.

public getApiBase() : string
Return values
string

getApiKey()

Get the API key of an EasyPostClient.

public getApiKey() : string
Return values
string

getMockingUtility()

Get the mock requests of an EasyPostClient.

public getMockingUtility() : object
Return values
object

getTimeout()

Get the timeout of an EasyPostClient.

public getTimeout() : float
Return values
float

mock()

Get whether this client is configured to mock requests

public mock() : bool
Return values
bool

allResources()

Internal retrieve all method.

protected allResources(string $class[, mixed $params = null ][, bool $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$beta : bool = false
Return values
mixed

className()

The class name of an object.

protected static className(string $class) : string
Parameters
$class : string
Return values
string

classUrl()

The class URL of an object.

protected static classUrl(string $class) : string
Parameters
$class : string
Return values
string

createResource()

Internal create method.

protected createResource(string $class[, mixed $params = null ][, bool $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$beta : bool = false
Return values
mixed

deleteResource()

Internal delete method.

protected deleteResource(string $class, string $id[, mixed $params = null ][, bool $beta = false ]) : void
Parameters
$class : string
$id : string
$params : mixed = null
$beta : bool = false
Return values
void

instanceUrl()

The instance URL of an object.

protected instanceUrl(string $class, string $id) : string
Parameters
$class : string
$id : string
Tags
throws
InvalidObjectException
Return values
string

retrieveResource()

Internal retrieve method.

protected retrieveResource(string $class, string $id[, bool $beta = false ]) : mixed
Parameters
$class : string
$id : string
$beta : bool = false
Return values
mixed

serviceModelClassName()

Gets the class name of a Service's model.

protected static serviceModelClassName(string $serviceClassName) : string
Parameters
$serviceClassName : string
Return values
string

updateResource()

Internal update method.

protected updateResource(string $class, string $id[, mixed $params = null ][, string $method = 'patch' ][, bool $beta = false ]) : mixed
Parameters
$class : string
$id : string
$params : mixed = null
$method : string = 'patch'
$beta : bool = false
Return values
mixed

validate()

Validate library usage.

protected static validate([array<string|int, mixed> $params = null ]) : mixed
Parameters
$params : array<string|int, mixed> = null
Tags
throws
InvalidParameterException
Return values
mixed

Search results