Documentation

Insurance extends EasypostResource
in package

Table of Contents

$amount  : string
$created_at  : string
$fee  : Fee
$from_address  : Address
$id  : string
$messages  : array<string|int, mixed>
$mode  : string
$object  : string
$provider  : string
$provider_id  : string
$reference  : string
$shipment_id  : string
$status  : string
$to_address  : Address
$tracker  : Tracker
$tracking_code  : string
$updated_at  : string
$_apiKey  : string
$_immutableValues  : array<string|int, mixed>
$_retrieveOptions  : array<string|int, mixed>
$_unsavedValues  : array<string|int, mixed>
$_values  : array<string|int, mixed>
$_name  : string
$_parent  : string
__construct()  : mixed
Constructor for EasyPost objects.
__get()  : mixed
Getter.
__isset()  : bool
`isset` magic method.
__set()  : mixed
Standard accessor magic methods.
__toArray()  : array<string|int, mixed>
Convert object to an array.
__toJSON()  : string
Convert object to JSON.
__toString()  : string
Convert object to a string.
__unset()  : mixed
`unset` magic method.
all()  : mixed
Retrieve all insurance objects.
className()  : string
The class name of an object.
classUrl()  : string
The class URL of an object.
constructFrom()  : mixed
Construct from.
create()  : mixed
Create an insurance object.
current()  : mixed
Iterator methods.
instanceUrl()  : string
The instance URL of an object.
key()  : mixed
Iterator methods.
next()  : mixed
Iterator methods.
offsetExists()  : bool
ArrayAccess methods.
offsetGet()  : mixed
ArrayAccess methods.
offsetSet()  : mixed
ArrayAccess methods.
offsetUnset()  : mixed
ArrayAccess methods.
refresh()  : $this
Refresh the object from the API.
refreshFrom()  : mixed
Refresh from.
retrieve()  : mixed
Retrieve an insurance object.
rewind()  : void
Iterator methods.
valid()  : bool
Iterator methods.
allResources()  : mixed
Internal retrieve all method.
createResource()  : mixed
Internal create method.
deleteResource()  : $this
Internal delete method.
retrieveResource()  : mixed
Internal retrieve method.
saveResource()  : $this
Internal update (save) method.
updateResource()  : $this
Internal update method.
validate()  : mixed
Validate library usage.

Properties

$messages

public array<string|int, mixed> $messages

$_immutableValues

protected array<string|int, mixed> $_immutableValues

$_retrieveOptions

protected array<string|int, mixed> $_retrieveOptions

$_unsavedValues

protected array<string|int, mixed> $_unsavedValues

Methods

__construct()

Constructor for EasyPost objects.

public __construct([string $id = null ][, string $apiKey = null ][, string $parent = null ][, string $name = null ]) : mixed
Parameters
$id : string = null
$apiKey : string = null
$parent : string = null
$name : string = null
Return values
mixed

__get()

Getter.

public __get(string $k) : mixed
Parameters
$k : string
Return values
mixed

__isset()

`isset` magic method.

public __isset(string $k) : bool
Parameters
$k : string
Return values
bool

__set()

Standard accessor magic methods.

public __set(string $k, mixed $v) : mixed
Parameters
$k : string
$v : mixed
Return values
mixed

__toArray()

Convert object to an array.

public __toArray([bool $recursive = false ]) : array<string|int, mixed>
Parameters
$recursive : bool = false
Return values
array<string|int, mixed>

__toJSON()

Convert object to JSON.

public __toJSON() : string
Return values
string

__toString()

Convert object to a string.

public __toString() : string
Return values
string

__unset()

`unset` magic method.

public __unset(string $k) : mixed
Parameters
$k : string
Return values
mixed

all()

Retrieve all insurance objects.

public static all([mixed $params = null ][, string $apiKey = null ]) : mixed
Parameters
$params : mixed = null
$apiKey : string = null
Return values
mixed

className()

The class name of an object.

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

classUrl()

The class URL of an object.

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

constructFrom()

Construct from.

public static constructFrom(array<string|int, mixed> $values[, string $class = null ][, string $apiKey = null ][, string $parent = null ][, string $name = null ]) : mixed
Parameters
$values : array<string|int, mixed>
$class : string = null
$apiKey : string = null
$parent : string = null
$name : string = null
Return values
mixed

create()

Create an insurance object.

public static create([mixed $params = null ][, string $apiKey = null ]) : mixed
Parameters
$params : mixed = null
$apiKey : string = null
Return values
mixed

current()

Iterator methods.

public current() : mixed
Return values
mixed

instanceUrl()

The instance URL of an object.

public instanceUrl() : string
Tags
throws
Error
Return values
string

key()

Iterator methods.

public key() : mixed
Return values
mixed

next()

Iterator methods.

public next() : mixed
Return values
mixed

offsetExists()

ArrayAccess methods.

public offsetExists(string $k) : bool
Parameters
$k : string
Return values
bool

offsetGet()

ArrayAccess methods.

public offsetGet(string $k) : mixed
Parameters
$k : string
Return values
mixed

offsetSet()

ArrayAccess methods.

public offsetSet(string $k, mixed $v) : mixed
Parameters
$k : string
$v : mixed
Return values
mixed

offsetUnset()

ArrayAccess methods.

public offsetUnset(string $k) : mixed
Parameters
$k : string
Return values
mixed

refresh()

Refresh the object from the API.

public refresh([bool $beta = false ]) : $this
Parameters
$beta : bool = false

Whether to use the beta endpoint (optional, default false)

Tags
throws
Error
Return values
$this

refreshFrom()

Refresh from.

public refreshFrom(array<string|int, mixed> $values, string $apiKey[, bool $partial = false ]) : mixed
Parameters
$values : array<string|int, mixed>
$apiKey : string
$partial : bool = false
Return values
mixed

retrieve()

Retrieve an insurance object.

public static retrieve(string $id[, string $apiKey = null ]) : mixed
Parameters
$id : string
$apiKey : string = null
Return values
mixed

rewind()

Iterator methods.

public rewind() : void
Return values
void

valid()

Iterator methods.

public valid() : bool
Return values
bool

allResources()

Internal retrieve all method.

protected static allResources(string $class[, mixed $params = null ][, string $apiKey = null ][, mixed $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$apiKey : string = null
$beta : mixed = false
Tags
throws
Error
Return values
mixed

createResource()

Internal create method.

protected static createResource(string $class[, mixed $params = null ][, string $apiKey = null ][, string $urlModifier = null ][, mixed $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$apiKey : string = null
$urlModifier : string = null
$beta : mixed = false
Tags
throws
Error
Return values
mixed

deleteResource()

Internal delete method.

protected deleteResource([mixed $params = null ][, mixed $noRefresh = null ]) : $this
Parameters
$params : mixed = null
$noRefresh : mixed = null
Tags
throws
Error
Return values
$this

retrieveResource()

Internal retrieve method.

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

saveResource()

Internal update (save) method.

protected saveResource(string $class[, mixed $beta = false ][, mixed $method = 'patch' ]) : $this
Parameters
$class : string
$beta : mixed = false
$method : mixed = 'patch'
Tags
throws
Error
Return values
$this

updateResource()

Internal update method.

protected updateResource([mixed $params = null ]) : $this
Parameters
$params : mixed = null
Tags
throws
Error
Return values
$this

validate()

Validate library usage.

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

Search results