You are here

interface SmsGatewayPluginInterface in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/SmsGatewayPluginInterface.php \Drupal\sms\Plugin\SmsGatewayPluginInterface
  2. 2.1.x src/Plugin/SmsGatewayPluginInterface.php \Drupal\sms\Plugin\SmsGatewayPluginInterface

Default implementation of SMS gateway plugin.

Hierarchy

Expanded class hierarchy of SmsGatewayPluginInterface

All classes that implement SmsGatewayPluginInterface

File

src/Plugin/SmsGatewayPluginInterface.php, line 18

Namespace

Drupal\sms\Plugin
View source
interface SmsGatewayPluginInterface extends ConfigurableInterface, DependentPluginInterface, PluginFormInterface, PluginInspectionInterface {

  /**
   * Sends an SMS.
   *
   * @param \Drupal\sms\Message\SmsMessageInterface $sms
   *   The sms to be sent.
   *
   * @return \Drupal\sms\Message\SmsMessageResultInterface
   *   The result of the sms messaging operation.
   */
  public function send(SmsMessageInterface $sms);

  /**
   * Returns the credit balance available on this gateway.
   *
   * The 'credit_balance_available' plugin annotation should be set to inform
   * the framework whether this gateway supports balance queries.
   *
   * @return float|null
   *   The credit balance of the gateway, or NULL if unknown.
   */
  public function getCreditsBalance();

  /**
   * Parses incoming delivery reports and returns the created delivery reports.
   *
   * The request contains delivery reports pushed to the site in a format
   * supplied by the gateway API. This method transforms the raw request into
   * delivery report objects usable by SMS Framework.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   Request object containing the unprocessed delivery reports.
   * @param \Symfony\Component\HttpFoundation\Response $response
   *   HTTP response to return to the server pushing the raw delivery reports.
   *
   * @return \Drupal\sms\Message\SmsDeliveryReportInterface[]
   *   An array of delivery reports created from the request.
   */
  public function parseDeliveryReports(Request $request, Response $response);

  /**
   * Gets delivery reports from the gateway.
   *
   * @param string[]|null $message_ids
   *   A list of specific message ID's to pull, or NULL to get any reports which
   *   have not been requested previously.
   *
   * @return \Drupal\sms\Message\SmsDeliveryReportInterface[]
   *   An array of the delivery reports which have been pulled.
   */
  public function getDeliveryReports(array $message_ids = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 14
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 15
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 15
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 20
PluginFormInterface::buildConfigurationForm public function Form constructor. 37
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
SmsGatewayPluginInterface::getCreditsBalance public function Returns the credit balance available on this gateway. 1
SmsGatewayPluginInterface::getDeliveryReports public function Gets delivery reports from the gateway. 1
SmsGatewayPluginInterface::parseDeliveryReports public function Parses incoming delivery reports and returns the created delivery reports. 1
SmsGatewayPluginInterface::send public function Sends an SMS. 4