PHP Class Zendesk\API\HttpClient

Inheritance: use trait Zendesk\API\Traits\Utility\InstantiatorTrait
显示文件 Open project: zendesk/zendesk_api_client_php Class Usage Examples

Public Properties

Property Type Description
$embeddable Zendesk\API\Resources\Embeddable
$guzzle GuzzleHttp\Client
$helpCenter Zendesk\API\Resources\HelpCenter
$voice Zendesk\API\Resources\Voice

Protected Properties

Property Type Description
$apiBasePath This is appended between the full base domain and the resource endpoint
$apiUrl string
$auth Zendesk\API\Utilities\Auth
$debug Zendesk\API\Debug
$hostname string
$port integer
$scheme string
$sideload array | null
$subdomain string

Public Methods

Method Description
__construct ( string $subdomain, string $username = '', string $scheme = "https", string $hostname = "zendesk.com", integer $port = 443, Client $guzzle = null )
delete ( $endpoint ) : null This is a helper method to do a delete request.
get ( $endpoint, array $queryParams = [] ) : stdClass This is a helper method to do a get request.
getApiBasePath ( ) : string Returns the api base path
getApiUrl ( ) : string Returns the generated api URL
getAuth ( ) : Auth
getDebug ( ) : Zendesk\API\Debug Returns debug information in an object
getHeaders ( ) : array
getSideload ( array $params = [] ) : array | null Sideload getter
getSubdomain ( ) : string Returns the supplied subdomain
getUserAgent ( ) : string Return the user agent string
getValidSubResources ( ) : array
post ( $endpoint, array $postData = [] ) : stdClass This is a helper method to do a post request.
put ( $endpoint, array $putData = [] ) : stdClass This is a helper method to do a put request.
setApiBasePath ( string $apiBasePath ) Sets the api base path
setAuth ( $strategy, array $options ) Configure the authorization method
setDebug ( mixed $lastRequestHeaders, mixed $lastRequestBody, mixed $lastResponseCode, string $lastResponseHeaders, mixed $lastResponseError ) Set debug information as an object
setHeader ( string $key, string $value ) : HttpClient
setSideload ( array $fields = null ) : HttpClient Sideload setter

Method Details

__construct() public method

public __construct ( string $subdomain, string $username = '', string $scheme = "https", string $hostname = "zendesk.com", integer $port = 443, Client $guzzle = null )
$subdomain string
$username string
$scheme string
$hostname string
$port integer
$guzzle GuzzleHttp\Client

delete() public method

This is a helper method to do a delete request.
public delete ( $endpoint ) : null
$endpoint
return null

get() public method

This is a helper method to do a get request.
public get ( $endpoint, array $queryParams = [] ) : stdClass
$endpoint
$queryParams array
return stdClass | null

getApiBasePath() public method

Returns the api base path
public getApiBasePath ( ) : string
return string

getApiUrl() public method

Returns the generated api URL
public getApiUrl ( ) : string
return string

getAuth() public method

public getAuth ( ) : Auth
return Zendesk\API\Utilities\Auth

getDebug() public method

Returns debug information in an object
public getDebug ( ) : Zendesk\API\Debug
return Zendesk\API\Debug

getHeaders() public method

public getHeaders ( ) : array
return array

getSideload() public method

Sideload getter
public getSideload ( array $params = [] ) : array | null
$params array
return array | null

getSubdomain() public method

Returns the supplied subdomain
public getSubdomain ( ) : string
return string

getUserAgent() public method

Return the user agent string
public getUserAgent ( ) : string
return string

getValidSubResources() public static method

public static getValidSubResources ( ) : array
return array

post() public method

This is a helper method to do a post request.
public post ( $endpoint, array $postData = [] ) : stdClass
$endpoint
$postData array
return stdClass | null

put() public method

This is a helper method to do a put request.
public put ( $endpoint, array $putData = [] ) : stdClass
$endpoint
$putData array
return stdClass | null

setApiBasePath() public method

Sets the api base path
public setApiBasePath ( string $apiBasePath )
$apiBasePath string

setAuth() public method

Configure the authorization method
public setAuth ( $strategy, array $options )
$strategy
$options array

setDebug() public method

Set debug information as an object
public setDebug ( mixed $lastRequestHeaders, mixed $lastRequestBody, mixed $lastResponseCode, string $lastResponseHeaders, mixed $lastResponseError )
$lastRequestHeaders mixed
$lastRequestBody mixed
$lastResponseCode mixed
$lastResponseHeaders string
$lastResponseError mixed

setHeader() public method

public setHeader ( string $key, string $value ) : HttpClient
$key string The name of the header to set
$value string The value to set in the header
return HttpClient

setSideload() public method

Sideload setter
public setSideload ( array $fields = null ) : HttpClient
$fields array
return HttpClient

Property Details

$apiBasePath protected_oe property

This is appended between the full base domain and the resource endpoint
protected $apiBasePath

$apiUrl protected_oe property

protected string $apiUrl
return string

$auth protected_oe property

protected Auth,Zendesk\API\Utilities $auth
return Zendesk\API\Utilities\Auth

$debug protected_oe property

protected Debug,Zendesk\API $debug
return Zendesk\API\Debug

$embeddable public_oe property

public Embeddable,Zendesk\API\Resources $embeddable
return Zendesk\API\Resources\Embeddable

$guzzle public_oe property

public Client,GuzzleHttp $guzzle
return GuzzleHttp\Client

$helpCenter public_oe property

public HelpCenter,Zendesk\API\Resources $helpCenter
return Zendesk\API\Resources\HelpCenter

$hostname protected_oe property

protected string $hostname
return string

$port protected_oe property

protected int $port
return integer

$scheme protected_oe property

protected string $scheme
return string

$sideload protected_oe property

protected array|null $sideload
return array | null

$subdomain protected_oe property

protected string $subdomain
return string

$voice public_oe property

public Voice,Zendesk\API\Resources $voice
return Zendesk\API\Resources\Voice