Overview
  • Namespace
  • Class

Namespaces

  • APWG
    • API
      • Alerts
      • Groups
      • Index
      • MalIP
      • Phish
      • ReportPhishing

Classes

  • AbstractClient

Interfaces

  • ClientInterface

Class AbstractClient

The abstract client interface implementation

Class AbstractClient

APWG\API\AbstractClient implements APWG\API\ClientInterface

Direct known subclasses

APWG\API\Alerts\AlertsClient, APWG\API\Groups\GroupsClient, APWG\API\Index\IndexClient, APWG\API\MalIP\MalIPClient, APWG\API\Phish\PhishClient, APWG\API\ReportPhishing\ReportPhishingClient

Abstract
Namespace: APWG\API
Package: APWG\API
Copyright: Copyright (c) 2017 The Anti-Phishing Working Group
Author: Andrew Breksa andrew@apwg.org
Located at APWG/API/AbstractClient.php

Methods summary

public
# __construct( string $base_uri, string $apiKey, array $guzzleOptions = [] )

AbstractAPI constructor.

AbstractAPI constructor.

Parameters

$base_uri
$apiKey access token
$apiKey
$base_uri the base uri of the api
$guzzleOptions
guzzle http options, overrides defaults
public array
# getGuzzleOptions( )

Get the default GuzzleHTTP options

Get the default GuzzleHTTP options

Returns

array
public APWG\API\AbstractClient
# setGuzzleOptions( array $guzzleOptions )

Set the default GuzzleHTTP options

Set the default GuzzleHTTP options

Parameters

$guzzleOptions

Returns

APWG\API\AbstractClient
public string
# getBaseUri( )

Get the API base URI

Get the API base URI

Returns

string
public APWG\API\AbstractClient
# setBaseUri( string $base_uri )

Set the base API URI

Set the base API URI

Parameters

$base_uri

Returns

APWG\API\AbstractClient
public Psr\Http\Message\ResponseInterface
# _call( $method, $path, array $options = [] )

Internal method to call the API

Internal method to call the API

Parameters

$method
$path
$options

Returns

Psr\Http\Message\ResponseInterface

Implementation of

APWG\API\ClientInterface::_call()
public APWG\API\ClientInterface
# getClient( )

Get the HTTP Client

Get the HTTP Client

Returns

APWG\API\ClientInterface
public APWG\API\AbstractClient
# setClient( APWG\API\ClientInterface $client )

Set the HTTP Client

Set the HTTP Client

Parameters

$client

Returns

APWG\API\AbstractClient
public string
# getApiKey( )

Return the API Key

Return the API Key

Returns

string
public APWG\API\AbstractClient
# setApiKey( string $apiKey )

Set the API key

Set the API key

Parameters

$apiKey

Returns

APWG\API\AbstractClient
public array
# getGlobalOptions( )

Get the global options that are merged with every request

Get the global options that are merged with every request

Returns

array
public APWG\API\AbstractClient
# setGlobalOptions( array $globalOptions )

Set the global options that are merged with every request

Set the global options that are merged with every request

Parameters

$globalOptions

Returns

APWG\API\AbstractClient
public Psr\Http\Message\ResponseInterface
# getCache( )

Get the most recent request

Get the most recent request

Returns

Psr\Http\Message\ResponseInterface

Implementation of

APWG\API\ClientInterface::getCache()
public
# setCache( Psr\Http\Message\ResponseInterface $cache )

Set the most recent request

Set the most recent request

Parameters

$cache

Implementation of

APWG\API\ClientInterface::setCache()

Properties summary

protected APWG\API\ClientInterface $client

The HTTP Client (GuzzleHTTP)

The HTTP Client (GuzzleHTTP)

#
protected string $apiKey

The API Key

The API Key

#
protected array $globalOptions

The options to be merged into every request

The options to be merged into every request

# []
protected string $base_uri

The API base URI

The API base URI

#
protected array $guzzleOptions

The default GuzzleHTTP options

The default GuzzleHTTP options

# [ 'timeout' => 5, 'curl' => [ CURLOPT_TIMEOUT => 0, CURLOPT_TIMEOUT_MS => 0, CURLOPT_CONNECTTIMEOUT => 0, ], ]
protected Psr\Http\Message\ResponseInterface $cache

The request cache, the most recent request

The request cache, the most recent request

#
API documentation generated by ApiGen