<commit_before><?php

/**
 * Contains a tutorial on how to use this PHP SDK.
 *
 * PHP versions 5 and 7
 *
 * @license http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 */

namespace Clx\Xms;

/**
 * An empty class whose documentation is a tutorial
 *
 * The purpose of this document is to present the basic concepts of
 * the CLX Communications HTTP REST Messaging API and how to use it
 * from PHP using the HTTP REST Messaging API SDK.
 *
 * HTTP REST Messaging API basics
 * ------------------------------
 *
 * HTTP REST Messaging API is a REST API that is provided by CLX
 * Communications for sending and receiving SMS messages. It also
 * provides various other services supporting this task such as
 * managing groups of recipients, tagging, and so forth.
 *
 * Note, for brevity we will in this document refer to HTTP REST
 * Messaging API as _XMS API_ and the HTTP REST Messaging API service
 * or HTTP endpoint as _XMS_.
 *
 * A great benefit of the XMS API is that it allows you to easily
 * create and send _batch SMS messages_, that is, SMS messages that
 * can have multiple recipients. When creating a batch message it is
 * possible to use _message templates_, which allows each recipient to
 * receive a personalized message.
 *
 * To use XMS it is necessary to have a _service plan identifier_ and
 * an _authentication token_, which can be obtained by creating an XMS
 * service plan.
 *
 * For full documentation of the XMS API please refer to the [REST API
 * documentation
 * site](https://www.clxcommunications.com/docs/sms/http-rest.html).
 * The documentation site contains up-to-date information about, for
 * example, status and error codes.
 *
 * Interacting with XMS through PHP
 * --------------------------------
 *
 * Using this PHP SDK, all interaction with XMS happens through an
 * _XMS client_, which can be created using the service plan
 * identifier and authentication token. Further configuration can be
 * performed on the XMS client but in the typical case a service plan
 * identifier and authentication token is sufficient.
 *
 * Once an XMS client has been created it is possible to send requests
 * to XMS and receive its responses. This is done by calling a
 * suitable method on the XMS client, supplying arguments as
 * necessary, and receiving the response as the return value.
 *
 * This SDK has a focus on asynchronous operation and all interaction
 * with XMS happens asynchronously. Therefore, while synchronous
 * methods are supplied within the library their use is discouraged in
 * most practical applications.
 *
 * The arguments passed to a connection method are sometimes very
 * simple, fetching a previously create batch simply requires the
 * batch identifier as argument. Other times the arguments are
 * complicated, for example to create the batch it may be necessary to
 * supply a large number of arguments that specify destination
 * addresses, the message body, expiry times, and so on. For such
 * complex arguments we use classes whose methods correspond to the
 * different parameters that are relevant for the request.
 *
 * In general the terms used in XMS carry through to the PHP API with
 * one major exception. The REST API uses the terms _to_ and _from_ to
 * indicate a message originator and message destination,
 * respectively. In the PHP API these are instead denoted _recipient_
 * and _sender_. The cause of this name change is to have less
 * confusing and more idiomatic PHP method names.
 *
 * Connection management
 * ---------------------
 *
 * The first step in using the XMS SDK is to create an XMS client
 * object, this object is instantiated from the
 * {@link \Clx\Xms\Client}
 * class and it describes everything we need in order to talk with the
 * XMS API endpoint. The minimal amount of information needed are the
 * service plan identifier and the authentication token and, as
 * previously mentioned, these will be provided to you when creating
 * an XMS service.
 *
 * Assuming we have been given the service plan identifier "myplan"
 * and authentication token "mytoken" then an XMS client `$client` is
 * created as follows
 *
 * ```php
 * $client = \Clx\Xms\Client('myserviceplan', 'mytoken');
 * ```
 *
 * Once created the client can be used to interact with with XMS in
 * the ways described in the following sections of this tutorial.
 *
 * By default the connection will use
 * `https://api.clxcommunications.com/xms` as XMS endpoint. This can
 * be overridden by providing an extra argument to the
 * {@link \Clx\Xms\Client} constructor. For example, the code
 *
 * ```php
 * $client = \Clx\Xms\Client(
 *     'myserviceplan',
 *     'mytoken',
 *     'https://my.test.host:3000/my/base/path'
 * );
 * ```<commit_msg>Remove duplicate word from tutorial<commit_after><?php

/**
 * Contains a tutorial on how to use this PHP SDK.
 *
 * PHP versions 5 and 7
 *
 * @license http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 */

namespace Clx\Xms;

/**
 * An empty class whose documentation is a tutorial
 *
 * The purpose of this document is to present the basic concepts of
 * the CLX Communications HTTP REST Messaging API and how to use it
 * from PHP using the HTTP REST Messaging API SDK.
 *
 * HTTP REST Messaging API basics
 * ------------------------------
 *
 * HTTP REST Messaging API is a REST API that is provided by CLX
 * Communications for sending and receiving SMS messages. It also
 * provides various other services supporting this task such as
 * managing groups of recipients, tagging, and so forth.
 *
 * Note, for brevity we will in this document refer to HTTP REST
 * Messaging API as _XMS API_ and the HTTP REST Messaging API service
 * or HTTP endpoint as _XMS_.
 *
 * A great benefit of the XMS API is that it allows you to easily
 * create and send _batch SMS messages_, that is, SMS messages that
 * can have multiple recipients. When creating a batch message it is
 * possible to use _message templates_, which allows each recipient to
 * receive a personalized message.
 *
 * To use XMS it is necessary to have a _service plan identifier_ and
 * an _authentication token_, which can be obtained by creating an XMS
 * service plan.
 *
 * For full documentation of the XMS API please refer to the [REST API
 * documentation
 * site](https://www.clxcommunications.com/docs/sms/http-rest.html).
 * The documentation site contains up-to-date information about, for
 * example, status and error codes.
 *
 * Interacting with XMS through PHP
 * --------------------------------
 *
 * Using this PHP SDK, all interaction with XMS happens through an
 * _XMS client_, which can be created using the service plan
 * identifier and authentication token. Further configuration can be
 * performed on the XMS client but in the typical case a service plan
 * identifier and authentication token is sufficient.
 *
 * Once an XMS client has been created it is possible to send requests
 * to XMS and receive its responses. This is done by calling a
 * suitable method on the XMS client, supplying arguments as
 * necessary, and receiving the response as the return value.
 *
 * This SDK has a focus on asynchronous operation and all interaction
 * with XMS happens asynchronously. Therefore, while synchronous
 * methods are supplied within the library their use is discouraged in
 * most practical applications.
 *
 * The arguments passed to a connection method are sometimes very
 * simple, fetching a previously create batch simply requires the
 * batch identifier as argument. Other times the arguments are
 * complicated, for example to create the batch it may be necessary to
 * supply a large number of arguments that specify destination
 * addresses, the message body, expiry times, and so on. For such
 * complex arguments we use classes whose methods correspond to the
 * different parameters that are relevant for the request.
 *
 * In general the terms used in XMS carry through to the PHP API with
 * one major exception. The REST API uses the terms _to_ and _from_ to
 * indicate a message originator and message destination,
 * respectively. In the PHP API these are instead denoted _recipient_
 * and _sender_. The cause of this name change is to have less
 * confusing and more idiomatic PHP method names.
 *
 * Connection management
 * ---------------------
 *
 * The first step in using the XMS SDK is to create an XMS client
 * object, this object is instantiated from the
 * {@link \Clx\Xms\Client}
 * class and it describes everything we need in order to talk with the
 * XMS API endpoint. The minimal amount of information needed are the
 * service plan identifier and the authentication token and, as
 * previously mentioned, these will be provided to you when creating
 * an XMS service.
 *
 * Assuming we have been given the service plan identifier "myplan"
 * and authentication token "<PASSWORD>" then an XMS client `$client` is
 * created as follows
 *
 * ```php
 * $client = \Clx\Xms\Client('myserviceplan', 'mytoken');
 * ```
 *
 * Once created the client can be used to interact with XMS in the
 * ways described in the following sections of this tutorial.
 *
 * By default the connection will use
 * `https://api.clxcommunications.com/xms` as XMS endpoint. This can
 * be overridden by providing an extra argument to the
 * {@link \Clx\Xms\Client} constructor. For example, the code
 *
 * ```php
 * $client = \Clx\Xms\Client(
 *     'myserviceplan',
 *     'mytoken',
 *     'https://my.test.host:3000/my/base/path'
 * );
 * ```
{'fraction_non_alphanumeric': 0.07651881437881017, 'fraction_numerical': 0.0021021652301870925, 'mean_word_length': 3.4421101774042953, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3900075', 'n_tokens_mistral': 2414, 'n_tokens_neox': 2340, 'n_words': 1333}