You are here

interface CloudFlareZoneInterface in CloudFlare 8

Zone methods for CloudFlare.

Hierarchy

Expanded class hierarchy of CloudFlareZoneInterface

All classes that implement CloudFlareZoneInterface

3 files declare their use of CloudFlareZoneInterface
SettingsForm.php in src/Form/SettingsForm.php
ZoneMock.php in tests/modules/cloudflare_form_tester/src/Mocks/ZoneMock.php
ZoneSelectionForm.php in src/Form/ZoneSelectionForm.php

File

src/CloudFlareZoneInterface.php, line 10

Namespace

Drupal\cloudflare
View source
interface CloudFlareZoneInterface {

  /**
   * Updates a zone's settings from CloudFlare's API.
   *
   * @param \CloudFlarePhpSdk\ApiTypes\Zone\ZoneSettings $zone_settings
   *   The updated settings object.
   */
  public function updateZoneSettings(ZoneSettings $zone_settings);

  /**
   * Gets the zone's settings from CloudFlare's API.
   *
   * @return \CloudFlarePhpSdk\ApiTypes\Zone\ZoneSettings|null
   *   Zone settings retrieved from the CloudFlareAPI. NULL if unable to
   *   retrieve.
   */
  public function getZoneSettings();

  /**
   * Retrieves a listing of zones in the current CloudFlare account.
   *
   * @return array
   *   A array of CloudFlareZones objects from the current CloudFlare account.
   *
   * @throws \CloudFlarePhpSdk\Exceptions\CloudFlareApiException
   *   Application level error returned from the API.
   */
  public function listZones();

  /**
   * Asserts that credentials are valid. Does NOT pull settings from CMI.
   *
   * @param string $apikey
   *   The secret Api key used to authenticate against CloudFlare.
   * @param string $email
   *   Email of the account used to authenticate against CloudFlare.
   * @param \Drupal\cloudflare\CloudFlareComposerDependenciesCheckInterface $composer_dependency_check
   *   Checks that composer dependencies are met.
   * @param \Drupal\cloudflare\CloudFlareStateInterface $state
   *   Tracks rate limits associated with CloudFlare Api.
   *
   * @throws CloudFlarePhpSdk\Exceptions\CloudFlareInvalidCredentialException
   *   Thrown if $apikey and $email fail to authenticate against the Api.
   * @throws CloudFlarePhpSdk\Exceptions\CloudFlareTimeoutException
   *   Thrown if the connection to the Api times out.
   * @throws CloudFlarePhpSdk\Exceptions\CloudFlareException
   *   Thrown if an unknown exception occurs when connecting to the Api.
   */
  public static function assertValidCredentials($apikey, $email, CloudFlareComposerDependenciesCheckInterface $composer_dependency_check, CloudFlareStateInterface $state);

}

Members

Namesort descending Modifiers Type Description Overrides
CloudFlareZoneInterface::assertValidCredentials public static function Asserts that credentials are valid. Does NOT pull settings from CMI. 2
CloudFlareZoneInterface::getZoneSettings public function Gets the zone's settings from CloudFlare's API. 2
CloudFlareZoneInterface::listZones public function Retrieves a listing of zones in the current CloudFlare account. 2
CloudFlareZoneInterface::updateZoneSettings public function Updates a zone's settings from CloudFlare's API. 2